rmdir
The rmdir command removes one or more directories. The directory must be empty in order to be removed or you must use the -f option. You can also specify more than one directory to be removed. Going back to our earlier discussion on permissions, you must have both write and execute permissions on the parent of a directory to be removed in order to remove it.
As with some of the other commands we have covered, you can use the -i option, which asks you to confirm each directory as it is removed. This means that if you are asked whether you really wish to remove a directory and you respond n, then it is not removed. If you respond y, it is removed.
The order in which you specify that directories are to be removed is significant. If you want ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access