Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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

1 Answer

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

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.