NAME
rmdir — remove
directories
SYNOPSIS
rmdir |
[-p] dir
... |
DESCRIPTION
The rmdir utility shall remove the
directory entry specified by each dir operand, which shall refer to an empty
directory. Directories shall 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
shall be specified before the parent directory so that the parent directory
will be empty when the rmdir utility tries to remove
it.
OPTIONS
The rmdir utility shall conform to the
utility argument syntax guidelines described in 2.10.2. The following option
shall be supported by the implementation:
-p-
Remove all directories in a pathname. For each dir operand:
- The directory entry it names shall be removed.
- If the dir operand includes more than one pathname component, effects
equivalent to the following command shall occur:
rmdir−p $(dirname dir)
OPERANDS
The following operand shall be supported by the implementation:
- dir
-
A pathname of an empty directory to be removed.
STANDARD INPUT
None.
INPUT FILES
None.
ENVIRONMENT VARIABLES
The following environment variables shall affect the execution of
rmdir:
LANG-
This variable shall determine the locale to use for the locale categories when both LC_ALL and the corresponding environment variable (beginning with LC_ ) do not specify a locale. See 2.6.
LC_ALL-
This variable shall determine the locale to be used to override any values for locale categories specified by the settings of LANG or any environment variables beginning with LC_.
LC_CTYPE-
This variable shall determine the locale for the interpretation of sequences of bytes of text data as characters (e.g., single- versus multibyte characters in arguments).
LC_MESSAGES-
This variable shall determine the language in which messages should be written.
ASYNCHRONOUS EVENTS
Default.
STANDARD OUTPUT
None.
STANDARD ERROR
Used only for diagnostic messages.
OUTPUT FILES
None.
EXTENDED DESCRIPTION
None.
EXIT STATUS
The rmdir utility shall exit with one of
the following values:
CONSEQUENCES OF ERRORS
Default.
RATIONALE
EXAMPLES
On historical System V systems, the −p option also caused a
message to be written to the standard output. The message indicated whether
the whole path was removed or part of the path remains for some reason. The
Standard Error subclause requires this diagnostic when the entire path
specified by a dir operand is not removed, but does not allow the status
message reporting success to be written as a diagnostic. 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. The rmdir
utility on System V also included an −s option that suppressed the
informational message output by the −p option. This option has been
omitted because the informational message is not specified by
POSIX.
2.