1
0
mirror of https://github.com/jbranchaud/til synced 2026-07-11 01:16:09 +00:00
Files
til/unix/display-the-target-of-a-symbolic-link.md
T
2026-07-10 14:03:54 -05:00

1.7 KiB
Raw Blame History

Display The Target Of A Symbolic Link

I have symlinked binaries all over my machine. Many of them are configured via my dotfiles setup. There are also tools like uv that install CLI tooling in a canonical place and then symlink it to a more user-friendly location.

ruff which I installed as a CLI tool via uv is a good example of this. When I look at the location of ruff via the which command, I get a bin directory that differed from where I expected uv to install it.

 which ruff
/Users/lastword/.local/bin/ruff

When I ls that directory, I can see it is full of symlinked binaries (as annotated by the trailing @ symbol).

 ls /Users/lastword/.local/bin
 ./                         cursor-agent@        pplay@                       tmux-fork-repo@
 ../                        figprev@             pyright@                     tmux-new-session@
 agent@                     ghprs@               pyright-langserver@          v@
 bic@                       git_better_branch@   pyright-python@              wait_for_port@
 bip@                       local-clone@         pyright-python-langserver@
 claude@                    nvims@               ruff@
 command-history-preview@   pingf@               task*

To resolve one of these symlinks to their target location, I can use the readlink utility.

 readlink /Users/lastword/.local/bin/ruff
/Users/lastword/.local/share/uv/tools/ruff/bin/ruff

And there it is, the actual directory where I expected uv to have installed ruff.

See man readlink for more details.