There are a few ways to know that a file is a symlink. Here’s one I learned today.
All my dotfiles are symlinks because I store them outside of the root directory. Here’s a conventional way to inspect a symlink:
ls -l ~/.zshrc
lrwxr-xr-x@ 1 jake staff 37 Jul 21 17:28 /Users/jake/.zshrc -> /Users/jake/code/dotfiles/./.zshrc
How do we know it’s a symlink? The l at the beginning of the permissions list
and the arrow -> are two clues.
Another options of inspecting a symlink is readlink:
readlink ~/.zshrc
/Users/jake/code/dotfiles/./.zshrc
It returns the symlink path. Files that aren’t symlinks do not return a path.
Tested on macOS 26 with zsh 5.9. See man readlink for more.