Rmdir command on Linux (remove directory)
The rmdir command on Linux removes one or more empty directories from the system.
The most common options are:
- -p Remove a directory and its subdirectories
- —ignore-fail-on-non-empty Ignore the error if the directory is not empty
Examples:
Remove the favorites directory:
Remove the a/b/c/d subdirectories:
Try to remove the music directory, but it’s not empty:
Learn much more about Linux in our online course. You can register here. If you already have an account, or want to create one, just log in or create your user here.
Did you like it?
Share