Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

There are two directories A and B and a file F which is located in B. The working directory is B.

How can you create a symbolic link in A pointing to F in B without changing the directory?

share|improve this question
add comment

2 Answers 2

up vote 2 down vote accepted
ln -s $(pwd)/F /full/path/to/A/link

Just supply the absolute path to both the file you want to link to and the the new symlink file. You can use pwd as a shortcut for your current path (e.g. B).

share|improve this answer
    
Great, thx for the quick help. –  Woltan Sep 14 '11 at 12:37
add comment

Try This (in bash);

 ln -s $(pwd)/${F} ${A}

Or this syntax in other shells

 ln -s `pwd`/${F} ${A}
share|improve this answer
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.