Delete a directory only if it is empty.
Section: Directory Creation and Removal
Remove empty directory
bash
bash
rmdir empty-dirLearn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Directory Creation and Removal
Create nested directories
Create a directory path including missing parents.
Copy directory recursively with preserved metadata
Copy directory trees while preserving timestamps and mode when possible.