Deleting a dir symlink

Good thing about shells is that they have so many features like tab-completion and bad thing is that these features can sometime turn against you.

I created a symlink to a directory and i was trying to delete it in bash and everytime i would do like:
rm symli<TAB>
and it would add a “/” at the end of the name, give an error that “symlinkblahblahblah” is a directory. I was really frustrated and couldn’t find out the issue untill someone helped me. While in this case zsh is better as it suggest a correction.

Conclusion:
If you are deleting a symlink to a dir, be sure to remove the trailing slash, which almost all shells will add if you use TAB to complete the name.

Tags: , , , , , , ,

Leave a Comment