Is it possible to set up a symbolic link such that
cd called on the link redirects to the linked path? Kind of like this:
$ ln /A/B /B/C $ cd /A/B $ pwd /B/C $
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
If you're using
zsh or any POSIX shell, then
cd -P pwd -P
or to make it permanent.
set -o physical
set -o chaselinks
alias cd='cd -P'
set symlinks = chase
But the effect you're seeing is created by the shell, not by the link itself. So the answer to your actual question is "no".