System Administration

Essential System Tools: fdupes – find or delete duplicate files

Last Updated on May 28, 2022

fdupes is a command-line interface tool, don’t expect any graphical frippery here.

The syntax doesn’t take long to master. To run a search for duplicates files you’ll want to specify two directories, such as:

$ fupes /path/to/dir/one /path/to/dir/two

This command will probably find no duplicate files. This is because fdupes does not, by default, follow sub-directories recursively.

You specify recursive searching with either the -r or -R flag (they perform different actions).

Depending on how many files and directories, it may take some time to build the file list and show you the duplicate files.

We recommend redirecting the output of fdupes to a file:

$ fdupes -r -s /path/to/dir/one /path/to/dir/two >> /tmp/fdupes-files.txt

Redirection helps because it’s easier to compare files using a text editor than reading the list using a terminal’s scroll back. You can then delete any directories or files at your leisure.

Let’s suppose you know a check will generate a large number of duplicate files. Say you want to keep only one files and delete all the other duplicates. You might be tempted to type at a shell.

$ fdupes -rdN /path/to/dir/one /path/to/dir/two

But when using -d, care should always be taken to ensure against accidental data loss.

Next page: Page 3 – Other Features

Pages in this article:
Page 1 – Introduction / Installation
Page 2 – In Operation
Page 3 – Other Features
Page 4 – Summary

Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Please read our FAQ before making a comment.

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments