Debian Codegraph @

upstream/debian-trixie/man1/rm.1

raw
1 .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.50.1.
2 .TH RM "1" "June 2025" "GNU coreutils 9.7" "User Commands"
3 .SH NAME
4 rm \- remove files or directories
5 .SH SYNOPSIS
6 .B rm
7 [\fI\,OPTION\/\fR]... [\fI\,FILE\/\fR]...
8 .SH DESCRIPTION
9 This manual page
10 documents the GNU version of
11 .BR rm .
12 .B rm
13 removes each specified file. By default, it does not remove
14 directories.
15 .P
16 If the \fI\-I\fR or \fI\-\-interactive=once\fR option is given,
17 and there are more than three files or the \fI\-r\fR, \fI\-R\fR,
18 or \fI\-\-recursive\fR are given, then
19 .B rm
20 prompts the user for whether to proceed with the entire operation. If
21 the response is not affirmative, the entire command is aborted.
22 .P
23 Otherwise, if a file is unwritable, standard input is a terminal, and
24 the \fI\-f\fR or \fI\-\-force\fR option is not given, or the
25 \fI\-i\fR or \fI\-\-interactive=always\fR option is given,
26 .B rm
27 prompts the user for whether to remove the file. If the response is
28 not affirmative, the file is skipped.
29 .SH OPTIONS
30 .PP
31 Remove (unlink) the FILE(s).
32 .TP
33 \fB\-f\fR, \fB\-\-force\fR
34 ignore nonexistent files and arguments, never prompt
35 .TP
36 \fB\-i\fR
37 prompt before every removal
38 .TP
39 \fB\-I\fR
40 prompt once before removing more than three files, or
41 when removing recursively; less intrusive than \fB\-i\fR,
42 while still giving protection against most mistakes
43 .TP
44 \fB\-\-interactive\fR[=\fI\,WHEN\/\fR]
45 prompt according to WHEN: never, once (\fB\-I\fR), or
46 always (\fB\-i\fR); without WHEN, prompt always
47 .TP
48 \fB\-\-one\-file\-system\fR
49 when removing a hierarchy recursively, skip any
50 directory that is on a file system different from
51 that of the corresponding command line argument
52 .TP
53 \fB\-\-no\-preserve\-root\fR
54 do not treat '/' specially
55 .TP
56 \fB\-\-preserve\-root\fR[=\fI\,all\/\fR]
57 do not remove '/' (default);
58 with 'all', reject any command line argument
59 on a separate device from its parent
60 .TP
61 \fB\-r\fR, \fB\-R\fR, \fB\-\-recursive\fR
62 remove directories and their contents recursively
63 .TP
64 \fB\-d\fR, \fB\-\-dir\fR
65 remove empty directories
66 .TP
67 \fB\-v\fR, \fB\-\-verbose\fR
68 explain what is being done
69 .TP
70 \fB\-\-help\fR
71 display this help and exit
72 .TP
73 \fB\-\-version\fR
74 output version information and exit
75 .PP
76 By default, rm does not remove directories. Use the \fB\-\-recursive\fR (\fB\-r\fR or \fB\-R\fR)
77 option to remove each listed directory, too, along with all of its contents.
78 .PP
79 Any attempt to remove a file whose last file name component is '.' or '..'
80 is rejected with a diagnostic.
81 .PP
82 To remove a file whose name starts with a '\-', for example '\-foo',
83 use one of these commands:
84 .IP
85 rm \fB\-\-\fR \fB\-foo\fR
86 .IP
87 rm ./\-foo
88 .PP
89 If you use rm to remove a file, it might be possible to recover
90 some of its contents, given sufficient expertise and/or time. For greater
91 assurance that the contents are unrecoverable, consider using \fBshred\fP(1).
92 .SH AUTHOR
93 Written by Paul Rubin, David MacKenzie, Richard M. Stallman,
94 and Jim Meyering.
95 .SH "REPORTING BUGS"
96 GNU coreutils online help: <https://www.gnu.org/software/coreutils/>
97 .br
98 Report any translation bugs to <https://translationproject.org/team/>
99 .SH "SEE ALSO"
100 \fBunlink\fP(1), \fBunlink\fP(2), \fBchattr\fP(1), \fBshred\fP(1)
101 .PP
102 .br
103 Full documentation <https://www.gnu.org/software/coreutils/rm>
104 .br
105 or available locally via: info \(aq(coreutils) rm invocation\(aq
106 .PP
107 .br
108 Packaged by Debian (9.7\-3)
109 .br
110 Copyright \(co 2025 Free Software Foundation, Inc.
111 .br
112 License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
113 .br
114 This is free software: you are free to change and redistribute it.
115 .br
116 There is NO WARRANTY, to the extent permitted by law.