Follow symlink
Use readlink -f /path/to/link
shell
# For a tool installed by Homebrew
$ readlink -f $(which cowsay)
# Get the full installation path of the actual binary
/opt/homebrew/Caskroom/cowsay/.../cowsay