$ rmdir
Remove empty directories
DOCUMENTEDFiles & directoriesUbuntu 24.04 LTS baseline
Synopsis
rmdir [OPTION]... DIRECTORY...
What it does
- `rmdir` removes directories only when they are empty.
- For non-empty directory trees, `rm -r` is the separate recursive removal operation.
Examples
Remove an empty directory
rmdir olddirRemove empty parents
rmdir -p a/b/cImportant details
These examples are intentionally conservative. Command behavior can still depend on filesystem state, permissions, locale, shell, installed package version, and other system configuration.
For exact option semantics, the linked authoritative documentation is the source of truth.