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 Vista. Windows 7. Windows Server 2008. Windows 8. Windows Server 2012. Windows 10.
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.
PTC MKS Toolkit for Power Users
PTC MKS Toolkit for System Administrators
PTC MKS Toolkit for Developers
PTC MKS Toolkit for Interoperability
PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition
PTC MKS Toolkit 10.0 Documentation Build 6.