rmdir(1) — Commands
OSF
NAME
rmdir − Removes a directory
SYNOPSIS
rmdir directory ...
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 permission in its parent directory. Use the ls -al command to see if a directory is empty.
EXAMPLES
To empty and remove a directory, enter:
rm mydir/∗ mydir/.∗
rmdir mydir
This removes the contents of mydir, then removes the empty directory. 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 contains filenames that begin with a . (dot) because the ls command does not normally list them unless you use the -a flag to see the files whose names begin with a . (dot).