1RM(1) User Commands RM(1)
2
3
4
6 rm - remove files or directories
7
9 rm [OPTION]... FILE...
10
12 This manual page documents the GNU version of rm. rm removes each
13 specified file. By default, it does not remove directories.
14
15 If the -I or --interactive=once option is given, and there are more
16 than three files or the -r, -R, or --recursive are given, then rm
17 prompts the user for whether to proceed with the entire operation. If
18 the response is not affirmative, the entire command is aborted.
19
20 Otherwise, if a file is unwritable, standard input is a terminal, and
21 the -f or --force option is not given, or the -i or --interac‐
22 tive=always option is given, rm prompts the user for whether to remove
23 the file. If the response is not affirmative, the file is skipped.
24
26 Remove (unlink) the FILE(s).
27
28 -f, --force
29 ignore nonexistent files and arguments, never prompt
30
31 -i prompt before every removal
32
33 -I prompt once before removing more than three files, or when
34 removing recursively; less intrusive than -i, while still giving
35 protection against most mistakes
36
37 --interactive[=WHEN]
38 prompt according to WHEN: never, once (-I), or always (-i);
39 without WHEN, prompt always
40
41 --one-file-system
42 when removing a hierarchy recursively, skip any directory that
43 is on a file system different from that of the corresponding
44 command line argument
45
46 --no-preserve-root
47 do not treat '/' specially
48
49 --preserve-root
50 do not remove '/' (default)
51
52 -r, -R, --recursive
53 remove directories and their contents recursively
54
55 -d, --dir
56 remove empty directories
57
58 -v, --verbose
59 explain what is being done
60
61 --help display this help and exit
62
63 --version
64 output version information and exit
65
66 By default, rm does not remove directories. Use the --recursive (-r or
67 -R) option to remove each listed directory, too, along with all of its
68 contents.
69
70 To remove a file whose name starts with a '-', for example '-foo', use
71 one of these commands:
72
73 rm -- -foo
74
75 rm ./-foo
76
77 Note that if you use rm to remove a file, it might be possible to
78 recover some of its contents, given sufficient expertise and/or time.
79 For greater assurance that the contents are truly unrecoverable, con‐
80 sider using shred.
81
82 GNU coreutils online help: <http://www.gnu.org/software/coreutils/>
83 Report rm translation bugs to <http://translationproject.org/team/>
84
86 Written by Paul Rubin, David MacKenzie, Richard M. Stallman, and Jim
87 Meyering.
88
90 Copyright © 2013 Free Software Foundation, Inc. License GPLv3+: GNU
91 GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
92 This is free software: you are free to change and redistribute it.
93 There is NO WARRANTY, to the extent permitted by law.
94
96 unlink(1), unlink(2), chattr(1), shred(1)
97
98 The full documentation for rm is maintained as a Texinfo manual. If
99 the info and rm programs are properly installed at your site, the com‐
100 mand
101
102 info coreutils 'rm invocation'
103
104 should give you access to the complete manual.
105
106
107
108GNU coreutils 8.22 October 2018 RM(1)