_
[/tmp/]$ cd sb # `pwd' says we are now in /tmp/ # let's change to /tmp/a/b/ [/tmp/sb/]$ cd ../ # Now we are in /tmp/a/b/ # But what is /tmp/a/b/'s parent dir? [/tmp/]$ # See? We didn't come back to /tmp/a/ BUT /tmp/It means that the current parent dirparent dir is the second from the right printed by
pwd.Let's add a symlink into dir
/tmp/a/b/:/tmp/ |__a/ | |__b/ | |__sa=../ -> /tmp/a/ # [/tmp/a/b/]$ ln -s ../ sa | |__sb=./a/b/ -> /tmp/a/b/This time, we will come back to the actual parent dirparent dir of
/tmp/a/b/.:[/tmp/]$ cd sb # change to /tmp/a/b/ [/tmp/sb/]$ cd sa # sa=../ # /tmp/sb/=/tmp/a/b/ # ^ or ^ [/tmp/sb/sa/]$ ls --classify b/ # ??? # We are now in /tmp/a/ because there is a b/ here!So Why this time it chooses to refer to the absolute path to determine the parent dirparent dir?