I have a project in its own directory:
/dir/to/project/
I have a symbolic link to that directory on the desktop:
/home/user/Desktop/project/
When I double click on that link, the directory window that opens is:
/home/user/Desktop/project/
instead of the real one, /dir/to/project
.
The same happens with the command line (Bash).
Is it possible to get what I wish, i.e. go to the directory pointed to, instead of the symbolic one?
Note: the windows environment I am using now is Xfce, but I am also interested in a generic answer.
Best Answer
In
bash
thecd
builtin uses-P
and-L
switches;pwd
understands them in the same way:Moreover
cd ..
may be tricky:See
help cd
andhelp pwd
. Note that you may also have an executable (i.e. not a shell builtin) like/bin/pwd
that should behave similarly. In my Kubuntu the difference is thepwd
builtin without any option uses-L
while/bin/pwd
by default uses-P
.You can adjust the default behavior of
cd
builtin byset -P
(cd
acts ascd -P
) andset +P
(cd
acts ascd -L
). Seehelp set
for details.