rmdir (Remove Directory)
When a directory is empty
You can delete an empty directory using the rmdir
(ReMove DIRectory) command.
For example, to delete an empty directory named dir_a under your working directory, run the command below.
rmdir dir_a
When a directory is not empty
The rmdir
command won't work for a non-empty directory. You need to use the rm
command with the -r
option like in the command below.
rm -r dir_a
The rm
command will be explained later.