Sunday, May 5, 2024
15
rated 0 times [  15] [ 0]  / answers: 1 / hits: 3136  / 2 Years ago, fri, april 22, 2022, 11:34:30

If I create a symbolic link in the terminal with a command like



ln -s /path/to/some/directory symbolicLink



and then follow the link with



cd symbolicLink



the terminal appears to think that the cwd is ~/symbolicLink/ even though it is actually showing ~/path/to/some/directory/ (assuming that the link was made in ~, of course). What this means is that if I then type cd .. I am taken back to ~, because the terminal 'thinks' this is the parent of the cwd.



What would I need to change such that cd .. would instead take me to ~/path/to/some/, i.e. the real parent of ~/path/to/some/directory/?


More From » command-line

 Answers
0

See https://stackoverflow.com/questions/10456784/behavior-of-cd-bash-on-symbolic-links.



You can use 'cd -P' to go to the "real" parent directory.
See the first comment on the top answer on how to make this the default behavior.


[#29984] Friday, April 22, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
raacket

Total Points: 198
Total Questions: 114
Total Answers: 111

Location: Czech Republic
Member since Mon, May 15, 2023
1 Year ago
raacket questions
;