1 .\" Copyright Andries Brouwer, A. Wik 1998, Ragnar Hojland Espinosa 1998-2002
3 .\" This file may be copied under the conditions described
4 .\" in the LDP GENERAL PUBLIC LICENSE, Version 1, September 1998
5 .\" that should have been distributed together with this file.
7 .TH RM 1 "18 June 2002" "GNU fileutils 4.1"
9 rm \- remove files or directories
11 .BI "rm [" options "] " file...
16 GNU options (shortest form):
18 .B "[\-\-help] [\-\-version] [\-\-]"
23 By default, it does not remove directories.
24 But when the \-r or \-R option is given, the entire directory tree
25 below the specified directory is removed (and there are no limitations
26 on the depth of directory trees that can be removed by `rm -r').
27 It is an error when the last path component of
30 (so as to avoid unpleasant surprises with `rm -r .*' or so).
32 If the \-i option is given, or
33 if a file is unwritable, standard input is a terminal, and the
37 prompts the user for whether to remove the file, writing a question
38 to stderr and reading an answer from stdin. If the response
39 is not affirmative, the file is skipped.
43 Do not prompt for confirmation. Do not write diagnostic messages.
44 Do not produce an error return status if the only errors were
48 Prompt for confirmation.
49 (In case both \-f and \-i are given, the last one given takes effect.)
51 .BR "\-r" " or " "\-R"
52 Recursively remove directory trees.
54 The System V Interface Definition forbids removal of the
55 last link to an executable binary file that is being executed.
57 The GNU implementation (in fileutils-3.16) is broken in the sense
58 that there is an upper limit to the depth of hierarchies that can be
59 removed. (If necessary, a utility `deltree' can be used to remove
63 .B "\-d, \-\-directory"
64 Remove directories with
69 require a directory to be empty before trying to unlink it. Only
70 works if you have appropriate privileges. Because unlinking a
71 directory causes any files in the deleted directory to become
72 unreferenced, it is wise to
74 the filesystem after doing this.
77 Ignore nonexistent files and never prompt the user.
79 .B "\-i, \-\-interactive"
80 Prompt whether to remove each file. If the response does not begin with `y'
81 or `Y', the file is skipped. Ignore previous \fB\-\-force\fR options.
83 .B "\-r, \-R, \-\-recursive"
84 Remove the contents of directories recursively.
87 Print the name of each file before removing it.
88 .SH "GNU STANDARD OPTIONS"
91 Print a usage message on standard output and exit successfully.
94 Print version information on standard output, then exit successfully.
97 Terminate option list.
99 The variables LANG, LC_ALL, LC_COLLATE, LC_CTYPE and LC_MESSAGES have the
102 POSIX 1003.2, except for the limitation on file hierarchy depth.
106 as found in the fileutils-4.1 package;
107 other versions may differ slightly. Mail corrections and additions to
108 aeb@cwi.nl and aw@mail1.bet1.puv.fi and ragnar@ragnar-hojland.com
109 Report bugs in the program to bug-fileutils@gnu.org.