DevOps

Removing a Unix sym link

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.


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

Similar posts

Get notified on new marketing insights

Be the first to know about new B2B SaaS Marketing insights to build or refine your marketing function with the tools and knowledge of today’s industry.