Section: Environments, Tables, and Troff Macros (7)
fdupes-help - fdupes interactive mode reference
When run interactively
(as fdupes --delete),
will show a list of duplicates and prompt the user for further action.
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
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.
SCROLLING THE LIST
The list of duplicates can be scrolled as follows:
Scroll down to the next page.
- PAGE DOWN
Scroll up to preceding page.
SHIFT + DOWN
Scroll down by one line. Not supported on some terminals.
SHIFT + UP
Scroll up by one line. Not supported on some terminals.
MOVING THE CURSOR
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:
Advance cursor to the next file on the list.
Move cursor back to the previous file.
Advance cursor to the next set of duplicates.
Move cursor back to the previous set.
Advance cursor to the next
set, if any.
Move cursor back to the previous
set, if any.
It is also possible to jump directly to a particular set:
Move cursor to the top of the set indicated by
- 'goto <index>'
TAGGING FILES USING THE CURSOR
Individual files can be tagged using the keys below. These keys all act on the current file, as identified by the cursor.
Tag current file for keeping.
- SHIFT + RIGHT
SHIFT + LEFT
Tag current file for deletion.
Remove tag from current file.
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.
As an example, given the following list of duplicates:
Set 1 of 5:
1 [ ] path/to/file_a
2 [ ] path/to/file_b
3 [ ] path/to/file_c
at the prompt and pressing ENTER will tell fdupes to tag
for keeping, and
for deletion. The special command
will tag all files for keeping.
There is one more command to deal with files in the current set:
Remove tags from all files in current set.
FILE SELECTION COMMANDS
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:
Select any files whose paths contain the given text.
- 'sel <text>'
Select any files whose paths begin with the given text.
Select any files whose paths end with the given text.
Select any file whose path matches the given text exactly.
Select any files whose paths match the given
Deselect any files whose paths contain the given text.
Deselect any files whose paths begin with the given text.
Deselect any files whose paths end with the given text.
Deselect any file whose path matches the given text exactly.
Deselect any files whose paths match the given
Clear all selections.
Invert selections within selected sets. For example, if files 1 and 4 in a set of 5 are selected,
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.
TAGGING SELECTED FILES
Once some files have been selected using the commands described above, the following commands can be used to tag selected files as desired:
Tag selected files for keeping.
Tag selected files for deletion.
Remove all tags from selected files.
Once tagged for deletion, files can be deleted by pressing
or using the
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.
- 'exit', 'quit'
Exit the program.
Display this help text.
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
the expression, whereas strings that break the pattern do not.
The syntax for regular expressions used by fdupes is known as the
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
Briefly, here are some examples of regular expressions:
Will match any string containing the sequence
Will match any string beginning with
abc123 and abc123x,
xabc123 or xabc123x.
The character '^' has special meaning, telling the program to match only those strings that begin with the pattern that follows.
Will match any string that ends with
abc123 and xabc123,
abc123x or xabc123x.
The character '$' has special meaning, telling the program to match only those strings that end with the preceding pattern.
Will match the string
and no other.
Will match any string containing
as in the first example, but it will also match strings containing
etc. The character '.' has special meaning, acting as a placeholder that will match any character in that position.
Will match any string beginning with the letter a and ending with the number 3, such as
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.
Will match any string containing the characters
followed immediately by one or more decimal digits, such as
abc123 and abc3210,
(note the space). Here \d 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, \d).
Will match any string containing one or more "word" characters followed immediately by one or more decimal digits, such as
abc123 and abcd3210,
(note the space). Here \w is a placeholder for a "word" character, and \d and '+' have the same meaning as in the preceding example.
This is just scratching the surface of what can be done with regular expressions. Consult the PCRE2 documentation for a complete reference.
The fdupes man page,