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