I have a folder "abc". I create a symlink: ln -s abc abclink. but then, whan I type, cd abclink it says "No such file or directory".

I can see the link, it has "lrwxr-xr-x" permissions, why doesn't it work? How to make it work?

link|improve this question
feedback

1 Answer

up vote 2 down vote accepted

Usually when you run into that, your target is invalid. i.e. abc doesn't exist. Yes, you can create symlinks to things that don't exist.

link|improve this answer
And is it possible to move a symlink around? To create it somewhere, to move it under another folder, while preserving its functionality? – Ecir Hana Jan 5 at 21:19
As long as the target has a full path... sure. but relative paths may not work so nice. i.e. ln -s ../some-dir/some-file some-file vs ln -s /dir/some-dir/some-file some-file – TheCompWiz Jan 5 at 21:25
Well, you can create them...they just don't work. – dmckee Jan 5 at 21:54
@dmckee: no clue what you're talking about. They do work... maybe not as you wanted them to work. You just need to understand the "why" they're working the way they are. – TheCompWiz Jan 5 at 22:03
feedback

Your Answer

 
or
required, but never shown

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