Today I encountered one of those irritating gotchas that has a simple solution, once you know what the solution is.
I was working on a Linux server and wanted to remove a symbolic link to a directory. I tried:
but this produced the error message:
rm: cannot remove `linkname/': Is a directory
After a few other tries, I did an online search, which revealed the solution. This is to run the command without the trailing slash (/):
The point is that is you including a trailing slash, the system thinks you want to delete a directory, whereas if you don’t, it thinks you mean a file. As the symbolic link is a file not a directory, even if it points to a directory as in this case, you need to use the slash-less form.