Take the 2-minute tour ×

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

share|improve this question
add comment

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.

share|improve this answer
add comment

Your Answer


