Blog

Removing a Unix sym link

Written by Metal Toad Staff | Sep 30, 2008 12:00:00 AM
Filed under:

If you try deleting a symbolic link like this:

rm -f test/

You get this:

rm: cannot remove `test/': Not a directory

Same deal if you try to use 'rmdir' to delete it.

Here's what works:
Remove the trailing slash from 'test/' and you're all gravy.

Though the sym link looks kind of like a directory, it is just a pointer to the linked file. So just delete it as you would any ol' file.

rm -f test