rmdir(C) 19 June 1992 rmdir(C) Name rmdir - remove directories Syntax rmdir [ -p ] [ -s ] dirname ... Description The rmdir command removes the entries for one or more sub-directories from a directory. A directory must be empty before it can be removed. (Note that the rm -r dir command is a more dangerous alternative to rmdir.) If the parent directory has the ``sticky'' bit set, removal occurs only if one of the following is true: + the parent directory is owned by the user + the dirname directory is owned by the user + the dirname directory is writable to the user + the user is the super user The -p option allows users to remove the directory dirname and its parent directories which become empty. A message is printed on standard output as to whether the whole path is removed or part of the path remains for some reason. The -s option is used to suppress the message printed on standard error when -p is in effect. rmdir will refuse to remove the root directory of a mounted filesystem. See also rm(C) Diagnostics rmdir returns an exit code of 0 if all the specified directories are removed successfully. Otherwise, it returns a non-zero exit code. Standards conformance rmdir is conformant with: AT&T SVID Issue 2.