Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.
>ls -alt
lrwxrwxrwx  1 root root   67 Aug  3 10:49 myFile.txt -> /some/where/else/myFile.txt

i want to cd to

/some/where/else/

by typing something like

follow myFile.txt

does Unix have something like that?

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

You could define a function:

follow () { cd $(dirname $(readlink -e "$1")); }
share|improve this answer
    
looks good, thanks –  jermdemo Aug 4 '10 at 17:25
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.