↑ ↓ select, Enter open, Esc close

Find duplicate files by checksum

Adjust the values, the command updates live
user@server
find /var/www/vhosts/example.com/httpdocs/wp-content/uploads -type f -size +0 -exec md5sum {} + | sort | uniq -w32 --all-repeated=separate

Computes the MD5 checksum of every non-empty file and shows only files whose checksum occurs more than once. Each group of identical files is separated by a blank line. MD5 is sufficient here, since the goal is finding duplicates, not tamper resistance.

Note: With many large files this takes a while, because every file is read completely. The fdupes package does the same job faster.

Also searched as

  • find duplicate files linux
  • find duplicate images in uploads
  • find identical files
  • same file stored twice

Related one-liners

All in Filesystem

Read first, then run.

The commands on myline.de act directly on servers, files and databases. A wrong path or placeholder can delete data irreversibly or make a server unreachable.

  • All commands are provided without warranty and are not tested on every system.
  • Understand what a command does before running it, and check every placeholder.
  • Make a backup first and, if possible, try it on a test system.
  • You run commands at your own risk. Liability for damages is excluded to the extent permitted by law.