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

User Commands (p - r) rm(1)
NAME
rm - Removes (unlinks) files or directories
SYNOPSIS
rm [-firR][-W NOG ][-W NOE ] file ...
FLAGS
-f Does not prompt before removing a file that does not have write permission set, and
does not display an error message if a specified file does not exist. If you specify both
the -f and -i ags when invoking the rm command, the flag that is specified last on the
command line takes effect.
-i Prompts you before deleting each file (interactive). When you use both the -i and -r
flags, the rm command also asks if you want to examine directories. If you specify
both the -f and -i flags when invoking the rm command, the flag that is specified last on
the command line takes effect.
-r Permits recursive removal of directories and their contents.
-R Permits recursive removal of directories and their contents (same as -r).
HP Extensions
-W NOG Specifies that the /G directory should be omitted when the initial directory is root
and a recursive flag (-R or -r) is used. This flag is ignored when the initial direc-
tory is not /, /E,or/E/system or when recursion does not occur.
-W NOE Specifies that the /E directory should be omitted when the initial directory is root
and a recursive flag (-R or -r) is used. This flag is ignored when the initial direc-
tory is not root or when recursion does not occur.
Specify both the -W NOG and -W NOE flags to omit both the /G and /E directories.
DESCRIPTION
The rm command removes the entries for the specified files from a directory.
If the file argument is of the directory type, the following steps are taken:
1. If neither the -R or -r flag is specified, rm writes a diagnostic message to standard error,
does nothing further with the file file, and goes on to any remaining files.
2. If the -f ag is not specified and either of the following is true, rm writes a prompt to
standard error and reads a line from standard input:
The permissions of the file file do not permit writing, and standard input is a ter-
minal.
The -i flag is specified.
If the response is affirmative, rm does nothing further with the current file and goes on to
any remaining files. (The same actions are taken if the -f flag is specified and file is not
of the directory type.)
3. For each entry contained in the file file, other than . (dot) or .. (dot dot) entries. Steps 1
through 3 are taken with the entry as if it were a file argument.
If an entry is the last link to a file, it is destroyed. To remove a file, you must have write permis-
527188-021 Hewlett-Packard Company 753