Monday 6 January 2014

Remove a symbolik link in Linux

Symbolik link is one that points to a file or directory, a kind of shortcut.
When it needs to be removed and you use the auto fill in of commands in the shell (TAB key) and you type rm then the name of the link, it will automatically add the name of the link and add a slash. This slash must be deleted in the command in order to be able to delete the symlink.

# correct way 
rm mySymLink
# incorrectly added slash
rm mySymLink/
 
The first one means you delete a file (which actually is the symlink) while the second is you want to delete a directory.
That's why you will get error you try to delete directory.
Also file permissions might be needed to be set up. 

No comments:

Post a Comment