Behavior of cd/bash on symbolic links
问题 Assume I have the folders ~/a/b in my home folder, and the folder b contains a symbolic link to '..' named 'symlink'. Then I perform the following actions in bash: hm@mach:~$ cd a/b/symlink hm@mach:~/a/b/symlink$ pwd -P /home/hm/a hm@mach:~/a/b/symlink$ cd .. hm@mach:~/a/b$ pwd -P /home/hm/a/b pwd -P prints the current working directory, dereferencing all symbolic links. Why is the working directory /home/hm/a/b at the end, and not /home/hm? 回答1: bash is being "friendly"; when you cd /into/a