rmdir - Remove a directory
rmdir [-p] directory ...
rmdir removes each requested directory. Each directory must be empty for rmdir to be successful.
- Removes all intermediate components. For example:
is equivalent to:
rmdir -p abc/def/ghi
rmdir abc/def/ghi rmdir abc/def rmdir abc
rmdir uses the following localization environment variables:
See Localization for more information.
- Successful completion.
- Failure to remove the directory. For example, the object is not a directory, the directory still contains files or subdirectories, or the user is not authorized.
- Failure because either the command-line option was incorrect or a directory name was not specified.
Possible error messages include:
- Nonempty directory
- Files or other directories are found under the directory to be removed. Use rm -r to remove the directory.
- No such directory
- The requested directory does not exist or is otherwise inaccessible.
POSIX.2, X/Open Portability Guide, UNIX systems.