Site icon LinuxCommands.site

rmdir command tutorial in linux/unix with examples and use cases

linux rmdir command – remove empty directories

Linux rmdir command is used to remove directories. If the directory is empty, it is removed. If the rmdir directory is not empty, the error message “Directory not empty”. You need to use the linux rm command to delete a non-empty directory.

Syntax

 mkdir [OPTION]... DIRECTORY...

Options

Examples & Use Cases

Remove empty parent and child directories

In the following example we will remove both the empty parent directory and the empty subdirectory at the same time.

 ➜  rmdir -p test-1/a

Exit mobile version