rmdir

rmdir is a simple and straightforward function that removes a directory, if, and only if, it is empty.

If you try and remove a non-empty directory using rmdir you will get an error. To remove a non-empty directory, you must use the rm command with the -r flag.