unlink symlink

How do I unlink this symlink.

Code:
ln -s /usr/local/lib/libintl.so.9 /usr/local/lib/libintl.so.8

Do I just preface the whole thing with unlink,or just part of it,thank you.
 
SirDice said:
# rm /usr/local/lib/libintl.so.8

Probably a dumb question but I have to make sure.

Will this only remove the symbolic link or will it also remove the file/directory from its original location? I read somewhere that you have to be real careful with removing symbolic links or else you'll end up removing the file/directory from its original location. Please advise. Thanks so much in advance.
 
Code:
ln -s file file.test
ls -lac
/bin/rm -v file.test
ls -lac
I just tested the new creation of file.test, removed it, and file still exists...
 
Sorry to revive this topic after such a long time, but regarding the question SirPsycho asked, about being sure that only the symlink is deleted and not the original directory:
The deciding factor here is the trailing /, so if we would have a symlink called /usr/local/symlink, then the command:
# rm /usr/local/symlink
will delete the symlink, while

# rm /usr/local/symlink/
will delete the files in the directory the symlink points to.
So be carefull with trailing slashes when working with symlinks!
 
$ rm yyy
( yyy is linked to a regular file, so the result isn't that surprising. If xxx were a directory, a plain rm would be of no use either. Use rmdir or rm -r, depending on whether the directory is empty or not.)
 
Back
Top