I created a soft link (ln -s 1 2
) to a directory which is inside the test
directory and opened the soft link (cd 2
) and displayed the current path using pwd
. The displayed path was ~/test/2
and not ~/test/1
.
It's different in an OS like Windows, the shortcut brings us to the real directory. I'm little bit confused how this soft link works in Linux. Is it not a shortcut like in Windows
? Why is the path not ~/test/1
?
$ mkdir test
$ cd test
$ mkdir 1
$ ln -s 1 2
$ cd 2
$ pwd
/home/dazz/test/2