How to find (and delete) duplicate files

I use fdupes for this. It is a commandline program which can be installed from the repositories with sudo apt install fdupes. You can call it like fdupes -r /dir/ect/ory and it will print out a list of dupes. fdupes has also a simple Homepage and a Wikipedia article, which lists some more programs.


FSlint has a GUI and some other features. The explanation of the duplicate checking algorithm from their FAQ:

1. exclude files with unique lengths
2. handle files that are hardlinked to each other
3. exclude files with unique md5(first_4k(file))
4. exclude files with unique md5(whole file)
5. exclude files with unique sha1(whole file) (in case of md5 collisions).

fslint Install fslint


List of programs/scripts/bash-solutions, that can find duplicates and run under nix:

  1. dupedit: Compares many files at once without checksumming. Avoids comparing files against themselves when multiple paths point to the same file.
  2. dupmerge: runs on various platforms (Win32/64 with Cygwin, *nix, Linux etc.)
  3. dupseek: Perl with algorithm optimized to reduce reads.
  4. fdf: Perl/c based and runs across most platforms (Win32, *nix and probably others). Uses MD5, SHA1 and other checksum algorithms
  5. freedups: shell script, that searches through the directories you specify. When it finds two identical files, it hard links them together. Now the two or more files still exist in their respective directories, but only one copy of the data is stored on disk; both directory entries point to the same data blocks.
  6. fslint: has command line interface and GUI.
  7. liten: Pure Python deduplication command line tool, and library, using md5 checksums and a novel byte comparison algorithm. (Linux, Mac OS X, *nix, Windows)
  8. liten2: A rewrite of the original Liten, still a command line tool but with a faster interactive mode using SHA-1 checksums (Linux, Mac OS X, *nix)
  9. rdfind: One of the few which rank duplicates based on the order of input parameters (directories to scan) in order not to delete in "original/well known" sources (if multiple directories are given). Uses MD5 or SHA1.
  10. rmlint: Fast finder with command line interface and many options to find other lint too (uses MD5), since 18.04 LTS has a rmlint-gui package with GUI (may be launched by rmlint --gui or from desktop launcher named Shredder Duplicate Finder)
  11. ua: Unix/Linux command line tool, designed to work with find (and the like).
  12. findrepe: free Java-based command-line tool designed for an efficient search of duplicate files, it can search within zips and jars.(GNU/Linux, Mac OS X, *nix, Windows)
  13. fdupe: a small script written in Perl. Doing its job fast and efficiently.1
  14. ssdeep: identify almost identical files using Context Triggered Piecewise Hashing