Open System Services Shell and Utilities Reference Manual (G06.25+, H06.03+)

rmdir(1) OSS Shell and Utilities Reference Manual
NAME
rmdir - Removes a directory
SYNOPSIS
rmdir [-p] directory ...
FLAGS
-p Removes all directories in a pathname. For each directory argument, the following
operations are performed:
1. The directory entry specied by directory is removed.
2. If the directory argument includes more than one pathname component, effects
equivalent to the following command occur:
rmdir -p $(dirname 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 whether a directory is empty.
If a directory and a subdirectory of that directory are specied in a single invocation of rmdir,
the subdirectory must be specied before the parent directory so that the parent directory is
empty when rmdir tries to remove it.
EXAMPLES
1. To empty and remove a directory, enter:
rm mydir/* mydir/.*
rmdir mydir
This command removes the contents of directory mydir, then removes the empty direc-
tory. 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/.* rst removes les 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 lenames that begin with a . (dot), because the ls command does not
normally list them unless you use the -a ag.
2. To remove all of the directories in the pathname a/b/c,enter:
rmdir -p a/b/c
Use a command like this one if directory a in the current directory is empty except that it
contains a directory b and a/b is empty except that it contains a directory c.
NOTES
Because /G and /E both appear in your local root directory, you should be very careful when
using OSS shell commands on or from the root directory. OSS shell commands that perform
recursive actions make no destinction between Guardian and OSS les or between local and
remote les.
RELATED INFORMATION
Commands: ls(1), rm(1).
Functions: rmdir(2), unlink(2).
756 Hewlett-Packard Company 527188-003