rmdir
rmdir is a command-line utility used to remove empty directories on many operating systems, including Unix-like systems and Windows (where the command is also accessible as rd). The command will remove the specified directory if and only if it is empty; attempting to remove a non-empty directory typically results in an error. It does not delete files within the directory, nor does it remove directories that are in use as the current working directory or that contain files.
Common options in Unix-like environments include -p or --parents to remove the directory and its ancestors if
In Windows, rmdir (rd) removes an empty directory; to remove a non-empty directory you can use rmdir
Typical usage is straightforward: rmdir dirname will remove the directory if it is empty. Use -p to
See also related commands such as rm and mkdir, which manage non-empty deletions and creation of directories,