Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. 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

I have this folder:

/var/www/vhosts/foo

that I need to access often. If I do (I'm root):

ln -s /var/www/vhosts/foo/
cd foo

pwd tells me /root/foo

What can I do to really go into the folder /var/www/vhosts/foo. I know that every action on /root/foo goes to /var/www/vhosts/foo, but what can I do so that pwd will tell me /var/www/vhosts/foo?

share|improve this question
up vote 4 down vote accepted

Use cd -P According to the POSIX spec,

-P
Handle the operand dot-dot physically; symbolic link components shall be resolved before dot-dot components are processed (see step 7. in the DESCRIPTION).

share|improve this answer
    
thanks really useful!!! – apelliciari Mar 23 '12 at 22:37

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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