The rmdir command removes each requested directory. Each directory must be empty for rmdir to be successful.
removes all intermediate components. For example,
rmdir -p abc/def/ghi
is equivalent to
rmdir abc/def/ghi rmdir abc/def rmdir abc
Possible exit status values are:
Failure because directory is not a directory, or because it still contains files or subdirectories.
Failure because of an invalid command line option, or no directory names specified.
- Non-empty directory
means that files or other directories are found under the directory to be removed. Use rm
-rto remove the directory.
- No such directory
means that the requested directory does not exist or is otherwise inaccessible.
- Current directory illegal
indicates that you should use cd to change to another directory before removing the current directory.
rmdir is provided as both an external utility and a built-in MKS KornShell utility.
POSIX.2. x/OPEN Portability Guide 4.0. All UNIX systems. Windows 2000. Windows XP. Windows Server 2003. Windows Vista. Windows 7. Windows Server 2008. Windows 8. Windows Server 2012.
A command of the same name comes with Windows. This command is provided as an alternative because it accepts multiple arguments and UNIX style file names.
MKS Toolkit for Power Users
MKS Toolkit for System Administrators
MKS Toolkit for Developers
MKS Toolkit for Interoperability
MKS Toolkit for Professional Developers
MKS Toolkit for Enterprise Developers
MKS Toolkit for Enterprise Developers 64-Bit Edition
MKS Toolkit 9.5 Documentation Build 3.