RMDIR(1)

NAME
rmdir - remove directories.

SYNOPSIS
rmdir [-p] dir...

DESCRIPTION
The rmdir utility will remove the directory entry specified by each dir operand, which must refer to an empty directory.

Directories will be processed in the order specified. If a directory and a subdirectory of that directory are specified in a single invocation of the rmdir utility, the subdirectory must be specified before the parent directory so that the parent directory will be empty when the rmdir utility tries to remove it.

OPTIONS

The following options are supported:

-p  Print version information on standard output then exit successfully. Remove all directories in a pathname. For each dir operand:

•   The directory entry it names will be removed.

•   If the dir operand includes more than one pathname component, effects equivalent to the following command will occur:

rmdir -p $(dirname dir)

--  Terminate option list (use it to delete a directory named "-p").

OPERANDS
The following operands are supported:

dir A pathname of a directory to be removed.

EXTENDED DESCRIPTION
rmdir passes the arguments to the rmdir(2) syscall directly if the option -p was not given. With this option, each argument is treated as in dirname(1) and passed to rmdir(2) repetitevely, untill the dirname procedure returns "."

EXIT STATUS
The following exit values are returned:

0   Each directory entry specified by a dir operand was removed successfully.

1   Failed to remove one or more directories

2   Unknown option

3   Missing operand

CONSEQUENCES OF ERRORS
If an error is detected, output will not be written to standard output and the exit status will not be zero.

APPLICATION USAGE
The definition of an empty directory is one that contains, at most, directory entries for dot and dot-dot.

EXAMPLES
If a directory a in the current directory is empty except it contains a directory b and a/b is empty except it contains a directory c :

rmdir -p a/b/c

will remove all three directories.

STANDARDS
The ASMIX rmdir utility is expected to conform to The Open Group Single Unix 2 Commands and Utilities specification.

SEE ALSO
rm(1), rmdir(2), unlink(2), remove(3).