19
tokumei
6y

I've got a puzzle! How well do you know the weird GNU coreutils error messages?

$ rm foo/
rm: cannot remove 'foo/': Is a directory

$ rm -r foo/
rm: cannot remove 'foo/': Not a directory

What am I?

Comments
  • 9
    A simlink?
  • 1
    A mount point
  • 5
    @WIPocket I can't tell whether that guess is from experience, but you're right! You can't remove a symlink to a directory if it has a trailing slash on its name, and if you try to remove it recursively, it'll delete everything in the tree that it's symlinked to, but it will fail once it gets to the link itself.
  • 2
    @tokumei Its just a guess. I write javascript and I just have an eye for bugs...
  • 0
    @tokumei how to delete it properly in the end?
  • 4
    Symlink.
    Use rm without trailing slash.
  • 2
    @HIGHphen what PrivateGER said, remove it like a normal file.
Add Comment