# 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.

```bash
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](https://www.ask-codey.com/glossary?category=unix&level=1)

Updated: November 10, 2026

Source: https://www.ask-codey.com/glossary/rmdir
