rdfind
may do what you want, but you'll need to depend on a cryptographic hash/checksum (md5, sha1 or sha256) in lieu of the filesize.
The hash is a stronger criteria than filesize, but this may or may not be what you want. For example, consider all of the metadata in a music file: If one file listed Schubert
as the composer, and the other potential duplicate listed Bruckner
as the composer and everything else in the file were exactly the same, the file size filter would classify it as a match, but the hash filter would not. The hash filter will use far more resources than file size filter, but that may not be a concern if you filter duplicates only occasionally.
Before you actually run rdfind
, make sure to read man rdfind
thoroughly and use the -dryrun
option until you're confident the results are what you want.
FWIW, this tutorial lists rdfind
, and 3 other utilities for finding duplicate files.
I don't know of a tool that filters on filesize, but if I were creating one from scratch, I think I'd cobble something together using find
and awk
. Let us know if that's what you want - I don't think it's terribly difficult, but there's not much point if rdfind
meets your needs.
duperemove
to save common extents in multiple files only once, with no other downside)