Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .