Say I have folder stucture:

|- dir1/
|  |-  sub1/
|
|- dir2/
   |- sub1link -> /dir1/sub1/

and my current working directory is sub1link, is there a quick way to either:

  • change directory to link source parent (i.e something similar to cd .. but take the user to /dir1/

  • change directory to link source (i.e switch from /dir2/sub1link/ straight to /dir1/sub1

link|improve this question

feedback

1 Answer

up vote 2 down vote accepted

Use cd -P ... Run help cd for more details. -L follows symlinks and is usually the default behavior, whereas -P uses the physical directory structure.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.