1FDUPES-HELP(7) Miscellaneous Information Manual FDUPES-HELP(7)
2
3
4
6 fdupes-help - fdupes interactive mode reference
7
8
10 When run interactively (as fdupes --delete), fdupes will show a list of
11 duplicates and prompt the user for further action.
12
13 The user can tell fdupes which files to keep or delete by tagging them
14 accordingly. Once tagged, the user can instruct fdupes to delete any
15 files that have been tagged for deletion. This can be done incremen‐
16 tally, if desired, successively tagging and deleting a limited number
17 of files at a time until no more duplicates remain to be processed.
18
19 There are several ways to tag files in fdupes: individually using the
20 cursor, by providing a list of files to keep, or by selecting files
21 that match particular search criteria and tagging those as desired.
22 Each of these approaches is discussed in detail in the sections below.
23
24
26 The list of duplicates can be scrolled as follows:
27
28 PAGE DOWN
29 Scroll down to the next page.
30
31
32 PAGE UP
33 Scroll up to preceding page.
34
35
36 SHIFT + DOWN
37 Scroll down by one line. Not supported on some terminals.
38
39
40 SHIFT + UP
41 Scroll up by one line. Not supported on some terminals.
42
43
45 The cursor tells fdupes which file and/or set of duplicates to act on,
46 as described in the next section. The cursor's position can be changed
47 as follows:
48
49
50 DOWN Advance cursor to the next file on the list.
51
52
53 UP Move cursor back to the previous file.
54
55
56 TAB Advance cursor to the next set of duplicates.
57
58
59 BACKSPACE
60 Move cursor back to the previous set.
61
62
63 F3 Advance cursor to the next selected set, if any.
64
65
66 F2 Move cursor back to the previous selected set, if any.
67
68
69 It is also possible to jump directly to a particular set:
70
71
72 'goto <index>'
73 Move cursor to the top of the set indicated by index.
74
75
77 Individual files can be tagged using the keys below. These keys all act
78 on the current file, as identified by the cursor.
79
80
81 SHIFT + RIGHT
82 Tag current file for keeping.
83
84
85 SHIFT + LEFT
86 Tag current file for deletion.
87
88
89 '?' Remove tag from current file.
90
91
92 Entire sets of files can be tagged by providing a list of indices in a
93 comma-separated list. Files in the current set whose indices appear on
94 the list will be tagged for keeping, while any other files in that set
95 will be tagged for deletion. As with individual files, the current set
96 is identified by the cursor.
97
98
99 As an example, given the following list of duplicates:
100
101 Set 1 of 5:
102
103 1 [ ] path/to/file_a
104 2 [ ] path/to/file_b
105 3 [ ] path/to/file_c
106
107
108 Typing '1, 3' at the prompt and pressing ENTER will tell fdupes to tag
109 file_a and file_c for keeping, and file_b for deletion. The special
110 command 'all' will tag all files for keeping.
111
112
113 There is one more command to deal with files in the current set:
114
115 'rg' Remove tags from all files in current set.
116
117
119 Another way to tag files is to first select them according to particu‐
120 lar search criteria and then tell fdupes what to do with them. The fol‐
121 lowing commands can be used to select files for tagging:
122
123
124 'sel <text>'
125 Select any files whose paths contain the given text.
126
127
128 'selb <text>'
129 Select any files whose paths begin with the given text.
130
131
132 'sele <text>'
133 Select any files whose paths end with the given text.
134
135
136 'selm <text>'
137 Select any file whose path matches the given text exactly.
138
139
140 'selr <expression>'
141 Select any files whose paths match the given regular expression
142 (see below).
143
144
145 'dsel <text>'
146 Deselect any files whose paths contain the given text.
147
148
149 'dselb <text>'
150 Deselect any files whose paths begin with the given text.
151
152
153 'dsele <text>'
154 Deselect any files whose paths end with the given text.
155
156
157 'dselm <text>'
158 Deselect any file whose path matches the given text exactly.
159
160
161 'dselr <expression>'
162 Deselect any files whose paths match the given regular expres‐
163 sion (see below).
164
165
166 'cs' Clear all selections.
167
168
169 'igs' Invert selections within selected sets. For example, if files 1
170 and 4 in a set of 5 are selected, igs will deselect files 1 and
171 4, and select files 2, 3, and 5. Immediately repeating the same
172 command will deselect files 2, 3, and 5, and select files 1 and
173 4, restoring selections to their previous state.
174
175
177 Once some files have been selected using the commands described above,
178 the following commands can be used to tag selected files as desired:
179
180 'ks' Tag selected files for keeping.
181
182
183 'ds' Tag selected files for deletion.
184
185
186 'rs' Remove all tags from selected files.
187
188
190 Once they've been tagged for deletion, files can be deleted by pressing
191 DELETE. Fdupes will delete any files that are tagged for deletion and
192 delist any sets whose remaining files have been tagged for keeping. For
193 safety, fdupes will refuse to act on sets for which all files have been
194 tagged for deletion. To handle these cases, tag at least one file for
195 keeping and run the delete command again.
196
197
199 'exit', 'quit'
200 Exit the program.
201
202
203 'help' Display this help text.
204
205
207 A regular expression is a sequence of characters defining a search pat‐
208 tern against which other character sequences can be compared. Strings
209 of characters that follow the pattern defined by an expression are said
210 to match the expression, whereas strings that break the pattern do not.
211
212 The syntax for regular expressions used by fdupes is known as the Perl
213 Compatible Regular Expression syntax. A detailed description of regular
214 expression syntax is beyond the scope of this document. For detailed
215 information the user is encouraged to consult the PCRE2 documentation:
216
217 https://www.pcre.org/current/doc/html/pcre2syntax.html
218
219
220 Briefly, here are some examples of regular expressions:
221
222
223 abc123 Will match any string containing the sequence abc123, such as
224 abc123, abc123x, xabc123, and xabc123x.
225
226
227 ^abc123
228 Will match any string beginning with abc123, such as abc123 and
229 abc123x, but not xabc123 or xabc123x. The character '^' has
230 special meaning, telling the program to match only those strings
231 that begin with the pattern that follows.
232
233
234 abc123$
235 Will match any string that ends with abc123, such as abc123 and
236 xabc123, but not abc123x or xabc123x. The character '$' has
237 special meaning, telling the program to match only those strings
238 that end with the preceding pattern.
239
240
241 ^abc123$
242 Will match the string abc123 and no other.
243
244
245 ab.123 Will match any string containing abc123 as in the first example,
246 but it will also match strings containing abz123, ab0123,
247 ab_123, etc. The character '.' has special meaning, acting as a
248 placeholder that will match any character in that position.
249
250
251 ^a.*3$ Will match any string beginning with the letter a and ending
252 with the number 3, such as abc123, a3, and a0b1c2d3. Here the
253 character '*' tells the program to accept any number of appear‐
254 ances (including none) for the preceding item (here, any charac‐
255 ter matching the placeholder character '.'). The characters '^'
256 and '$' have the same meaning as in previous examples.
257
258
259 abc\d+ Will match any string containing the characters abc followed
260 immediately by one or more decimal digits, such as abc123 and
261 abc3210, but not abcd123 or abc 123 (note the space). Here \d is
262 a placeholder for any decimal digit, while the character '+'
263 tells the program to match one or more appearances of the pre‐
264 ceding character or placeholder (here, \d).
265
266
267 \w+\d+ Will match any string containing one or more "word" characters
268 followed immediately by one or more decimal digits, such as
269 abc123 and abcd3210, but not abc 123 (note the space). Here \w
270 is a placeholder for a "word" character, and \d and '+' have the
271 same meaning as in the preceding example.
272
273
274 This is just scratching the surface of what can be done with regular
275 expressions. Consult the PCRE2 documentation for a complete reference.
276
277
279 The fdupes man page, fdupes(1).
280
281
282
283 FDUPES-HELP(7)