Removes a directory.
rmdir [ -p ] Directory ...
| Item | Description | 
|---|---|
| -pDirectory | Removes all directories along the path name specified by the Directory parameter. Parent directories must be empty and the user must have write permission in the parent directories before they can be removed. | 
This command returns the following exit values:
| Item | Description | 
|---|---|
| 0 | Each directory entry specified by a Directory parameter was removed successfully. | 
| >0 | An error occurred. | 
rm mydir/* mydir/.*
rmdir mydirNote that the rm mydir/* mydir/.* command first removes files with names that do not begin with a dot, and then removes those with names that do begin with a dot. You may not realize that the directory contains file names that begin with a dot because the ls command does not usually list them unless you use the -a flag.
rmdir -p /home/demo/mydir| Item | Description | 
|---|---|
| /usr/bin/rmdir | Contains the rmdir command. |