0

This question already has an answer here:

I made a symlink to a directory like this:

ln -s /some/directory symlink

Now I'd like to remove the symlink:

rm symlink/

This doesn't work. The error message is:

rm: cannot remove 'symlink/': Is a directory

What am I doing wrong? Why does rm claim my symlink is a directory? How to remove the symlink properly?

marked as duplicate by muru, Community Apr 11 '18 at 5:28

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

6

There is this question: When should I use a trailing slash on a directory? and one of the answers says:

rm won't let you remove a symlink to a directory if there's a slash at the end

It's like you told rm the object is a directory.

rm symlink/   # wrong
rm symlink    # right

Not the answer you're looking for? Browse other questions tagged or ask your own question.