rm - remove files or directories
rm [options] file...
POSIX options: [-fiRr]
GNU options (shortest form): [-dfirvR] [--help] [--version]
rm removes each given file. By default, it does not remove
directories. But when the -r or -R option is given, the
entire directory tree below the specified directory is
removed (and there are no limitations on the depth of direc-
tory trees that can be removed by `rm -r'). It is an error
when the last path component of file is either . or .. (so
as to avoid unpleasant surprises with `rm -r .*' or so).
If the -i option is given, or if a file is unwritable, stan-
dard input is a terminal, and the -f option is not given, rm
prompts the user for whether to remove the file, writing a
question to stderr and reading an answer from stdin. If the
response is not affirmative, the file is skipped.
-f Do not prompt for confirmation. Do not write diagnostic
messages. Do not produce an error return status if the
only errors were nonexisting files.
-i Prompt for confirmation. (In case both -f and -i are
given, the last one given takes effect.)
-r or -R
Recursively remove directory trees.
The System V Interface Definition forbids removal of the
last link to an executable binary file that is being exe-
The GNU implementation (in fileutils-3.16) is broken in the
sense that there is an upper limit to the depth of hierar-
chies that can be removed. (If necessary, a utility `del-
tree' can be used to remove very deep trees.)
Remove directories with unlink(2) instead of rmdir(2),
and don't require a directory to be empty before trying
to unlink it. Only works if you have appropriate
privileges. Because unlinking a directory causes any
files in the deleted directory to become unreferenced,
it is wise to fsck(8) the filesystem after doing this.
Ignore nonexistent files and never prompt the user.
Prompt whether to remove each file. If the response
does not begin with `y' or `Y', the file is skipped.
-r, -R, --recursive
Remove the contents of directories recursively.
Print the name of each file before removing it.
GNU STANDARD OPTIONS
Print a usage message on standard output and exit suc-
Print version information on standard output, then exit
-- Terminate option list.
The variables LANG, LC_ALL, LC_COLLATE, LC_CTYPE and
LC_MESSAGES have the usual meaning.
POSIX 1003.2, except for the limitation on file hierarchy
This page describes rm as found in the fileutils-3.16 pack-
age; other versions may differ slightly. Mail corrections
and additions to firstname.lastname@example.org and email@example.com and
firstname.lastname@example.org . Report bugs in the program to