Answers:
对于的任何POSIX实现cd,您都可以使用-P选项来执行此操作。
$ help cd
...
-P use the physical directory structure without following symbolic links
...
您可以在此处查看其运行情况:
$ mkdir foo
$ ln -s foo bar
$ cd -P bar
$ pwd
/tmp/tmp.WkupF2Ucuh/foo
如果您希望将其作为默认行为,则可以为创建别名cd,如下所示:
alias cd='cd -P'
...或使用set -o physical。对于tcsh,等效命令为set symlinks=chase。