rmdir

noun

say it: “ar-em-DUR” /ˌɑrɛmˈdɜr/

A terminal command that deletes a folder only when the folder is empty, so it can never take files with it.

What does rmdir do?

rmdir deletes a folder, and refuses when the folder still has anything in it. That refusal is the point: it can never take files with it. For a folder that isn't empty, rm -r deletes everything inside, so look first.

rmdir hallway/box-books

In a sentence

  • “The box was unpacked, so rmdir box-books removed the empty folder.”
  • “rmdir refused to delete box-bedroom, because the pillow was still inside.”

Level: Novice · More Unix terms at this level

Updated