The rmdir Command

The rmdir command will delete an empty directory. What this means is that the directory you want to remove cannot contain any data within it.

To remove a directory, do the following:

1.
Decide which directory, or directories, you want out of your way.
2.
Issue the rmdir command as rmdir <directory>.

Don't Forget! You Can Do Many At Once! Don't forget that you can remove multiple directories at one time. As with most file management commands, specify the directories in sequence and they will be removed. For example, if you wanted to remove “test” and “test1,” the two directories could be removed with one issuance of the rmdir

Get SAMS Teach Yourself Unix in 10 Minutes now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.