rmdir
rmdir linux command cheatsheet by Thamizhiniyan C S
Introduction
This command is used to remove the DIRECTORY(ies), if they are empty.
Syntax
rmdir [OPTION]... DIRECTORY...
Important Flags
Flag | Description |
---|---|
| Doesn't show an error message when trying to remove a non-empty directory. |
| Removes the directory along with its parent in the hierarchy. |
| Provides a verbose output. |
| Displays help text. |
| Displays the command version. |
Examples
Command | Description |
---|---|
Removes multiple directories using the basic rmdir command. | |
Removes the LINUX, INFO, and DETAIL directories. | |
Deletes a directory, including all subdirectories. | |
Deletes the LINUX directory, including all its ancestors. | |
Removes a subdirectory and its hierarchical parent and lists each step of the process. | |
Displays a message after removing the specified directories. | |
Deletes the LINUX, INFO, and DETAIL directories and displays a message after each removal. | |
Deletes all directories that contain "LINUX" in their name and displays a message after each removal. | |
Removes multiple directories in reverse order of hierarchy and lists each step of the process. | |
Removes multiple directories with similar names using wildcards and lists each step of the process. | |
Ignores errors due to non-empty directories when attempting to remove the LINUX directory. |
Last updated