rmdir

remove directory 

Command, KornShell Built-in


SYNOPSIS

rmdir [-p] directory...


DESCRIPTION

The rmdir command removes each requested directory. Each directory must be empty for rmdir to be successful.

Options

-p 

removes all intermediate components. For example,

rmdir -p abc/def/ghi

is equivalent to

rmdir abc/def/ghi
rmdir abc/def
rmdir abc


DIAGNOSTICS

Possible exit status values are:

0 

Successful completion.

1 

Failure because directory is not a directory, or because it still contains files or subdirectories.

2 

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 -r to 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.


NOTE

rmdir is provided as both an external utility and a built-in MKS KornShell utility.


PORTABILITY

POSIX.2. x/OPEN Portability Guide 4.0. All UNIX systems. Windows 2000. Windows XP. Windows Server 2003. Windows Vista.

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.


AVAILABILITY

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


SEE ALSO

Commands:
mkdir, rm, sh


MKS Toolkit 9.2 Documentation Build 16.