Tuesday, September 28, 2010

Create symlink

A symlink can be created like:

ln -s /path/ linkname

from the ln man pages:

ln [OPTION]… [-T] TARGET LINK_NAME (1st form)

-s, –symbolic
make symbolic links instead of hard links

to remove a symlink

rm linkname

What is important here is to note that the command doesn’t have the trailing slash

$ rm linkname/

will output the error:
rm: cannot remove `linkname/': Is a directory

$ rmdir linkname/
will output:
rmdir: linkname/: Not a directory

So it’s a directory or not?? i guess different tools have different ways of looking at this. Isn’t GNU/Linux great?! :D

No comments: