*** UNIX MANUAL PAGE BROWSER ***

A Nergahak database for man pages research.

Navigation

Directory Browser

1Browse 4.4BSD4.4BSD
1Browse Digital UNIXDigital UNIX 4.0e
1Browse FreeBSDFreeBSD 14.3
1Browse MINIXMINIX 3.4.0rc6-d5e4fc0
1Browse NetBSDNetBSD 10.1
1Browse OpenBSDOpenBSD 7.7
1Browse UNIX v7Version 7 UNIX
1Browse UNIX v10Version 10 UNIX

Manual Page Search

Manual Page Result

0 Command: rmdir | Section: 1 | Source: Digital UNIX | File: rmdir.1.gz
rmdir(1) General Commands Manual rmdir(1) NAME rmdir - Removes a directory SYNOPSIS rmdir [-p] directory... STANDARDS Interfaces documented on this reference page conform to industry stan- dards as follows: rmdir: XPG4, XPG4-UNIX Refer to the standards(5) reference page for more information about in- dustry standards and associated tags. OPTIONS Removes all directories in a path name. For each directory argument, the directory entry it names is removed. If the directory argument includes more than one path name com- ponent, effects equivalent to the following command occur: rmdir -p $(dirname directory) That is, rmdir recursively removes each directory in the path name. OPERANDS The path name of an empty directory to be removed. DESCRIPTION The rmdir command removes a directory from the system. The directory must be empty before you can remove it, and you must have write permis- sion in its parent directory. Use the ls -al command to see if a di- rectory 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 empty when rmdir tries to remove it. RESTRICTIONS A directory must be empty before you can remove it, and you must have write permission in its parent directory. If the -p option is used, all directories in the path must be empty except for the directory be- ing recursively removed. EXIT STATUS The following exit values are returned: Each directory specified by di- rectory operand was successfully removed. An error occurred. EXAMPLES To empty and remove a directory, enter: rm mydir/* mydir/.* rmdir my- dir This removes the contents of mydir, then removes the empty di- rectory. The rm command displays an error message about trying to remove the directories . (dot) and .. (dot dot), and then rmdir removes them. Note that rm mydir/* mydir/.* first removes files with names that do not begin with a (dot), then those with names that do begin with a (dot). You may not realize that the directory con- tains file names that begin with a (dot) because the ls command does not normally list them unless you use the -a option to see the files whose names begin with a (dot). To remove all of the directories in the path name a/b/c, enter: rmdir -p a/b/c Use a command like this one if directory a in the current direc- tory is empty except that it contains a directory b and a/b is empty except that it contains a directory c. ENVIRONMENT VARIABLES The following environment variables affect the execution of rmdir: Pro- vides a default value for the internationalization variables that are unset or null. If LANG is unset or null, the corresponding value from the default locale is used. If any of the internationalization vari- ables contain an invalid setting, the utility behaves as if none of the variables had been defined. If set to a non-empty string value, over- rides the values of all the other internationalization variables. De- termines the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as opposed to multi- byte characters in arguments). Determines the locale for the format and contents of diagnostic messages written to standard error. Deter- mines the location of message catalogues for the processing of LC_MES- SAGES. SEE ALSO Commands: mkdir(1), ls(1), rm(1) Functions: rmdir(2), unlink(2), remove(3) Standards: standards(5) rmdir(1)

Navigation Options