• setsubyou@lemmy.world
    link
    fedilink
    arrow-up
    3
    arrow-down
    1
    ·
    7 hours ago

    On Linux, rm can delete empty directories with -d too, not just with -r.

    rmdir is the counterpart to mkdir, which creates empty directories, so of course it can only remove empty directories. After all mkdir can’t create full directories either. There however is rmdir -p as a counterpart to mkdir -p, so if there is something in the directory, you can use that, as long as the something is an empty directory.

    • Captain Aggravated@sh.itjust.works
      link
      fedilink
      English
      arrow-up
      4
      arrow-down
      1
      ·
      edit-2
      5 hours ago

      Yeah it still has a certain “AAAAH! You didn’t say simon says” feel to it when you’re actually trying to get things done. Like imagine if you had to choose a different option from a context menu to delete a folder in a GUI. If there was an option for Remove File and another one placed a little elsewhere in the menu that says Remove Directory.

      I’m still gonna call it an unsanded corner.