rmdir - Removes a directory
rmdir [-p] directory...
Interfaces documented on this reference page conform to industry standards as follows:
rmdir: XPG4, XPG4-UNIX
Refer to the
reference page for more information
about industry standards and associated tags.
Removes all directories in a path name. For each directory argument, the directory entry it names is removed.
The path name of an
The rmdir command removes a directory from the system. The directory must be empty before you can remove it, and you must have write permission in its parent directory. Use the ls -al command to see if a directory is empty.
If a directory and a subdirectory of that directory are specified in
a single invocation of
rmdir, the subdirectory must be
specified before the parent directory so that the parent directory will be
tries to remove it.
A directory must be empty before you can remove it, and you
must have write permission in its parent directory.
option is used, all directories
in the path must be empty except for the directory being recursively removed.
The following exit values are returned:
Each directory specified by
operand was successfully removed.
An error occurred.
To empty and remove a directory, enter: rm mydir/* mydir/.* rmdir mydir
The following environment variables affect the execution of
Provides a default value for the internationalization variables
that are unset or null. If
is unset or null, the corresponding value from the default locale is used.
If any of the internationalization variables contain an invalid setting, the
utility behaves as if none of the variables had been defined.
If set to a non-empty string value, overrides the values of
all the other internationalization variables.
Determines the locale for the interpretation of sequences
of bytes of text data as characters (for example, single-byte as opposed to
multibyte characters in arguments).
Determines the locale for the format and contents of diagnostic
messages written to standard error.
Determines the location of message catalogues for the processing
Commands: mkdir(1), ls(1), rm(1)
Functions: rmdir(2), unlink(2), remove(3)