Open System Services Shell and Utilities Reference Manual (G06.25+, H06.03+)
Table Of Contents
rm(1) OSS Shell and Utilities Reference Manual
equivalent of a y, rm deletes the file. If the response is anything else, the rm command does
nothing to that file and continues with the next specified file.
The -i flag causes rm to prompt and read the standard input even if the standard input is not a ter-
minal. In the absence of -i, however, the prompting is not done when the standard input is not a
terminal.
Environment Variables
The following environment variables affect the execution of the rm command:
LC_MESSAGES
Determines the locale’s equivalent of y or n (for yes/no queries).
UTILSGE Specifies that HP extensions to the root directory should be omitted when the ini-
tial directory is root and a recursive operation occurs in an OSS shell command.
Application programs that test this variable might also honor its settings.
The UTILSGE value can be any of the following:
NOE Omit the /E directory.
NOG Omit the /G directory.
NOG:NOE Omit both the /G and /E directories.
The effect of assigning a value to the UTILSGE environment variable is the
same as specifying the -W NOG or -W NOE flag in the command.
EXAMPLES
1. To delete a file, enter:
rm myfile
If there is another link to this file, then the file remains under that name, but the file
myfile is removed. If myfile is the only link, the file itself is deleted.
2. To delete a file silently, enter:
rm -f core
This command removes file core without asking any questions or displaying any error
messages. This is normally used in shell procedures. It prevents confusing messages
from being displayed when deleting files that may or may not exist.
3. To delete files interactively, enter:
rm -i mydir/*
After each filename is displayed, enter the affirmative response; press <Return> (or any-
thing other than the affirmative response) to retain the file.
4. To delete a directory tree interactively, enter:
rm -ir manual
This recursively removes the contents of all subdirectories of the file manual, then
removes manual itself, asking if you want to remove each file and directory.
7−54 Hewlett-Packard Company 527188-003