DUFF

apt-get update; apt-get install duff; # install duff

Examples

Normal mode

Shows normal output, with a header before each cluster of duplicate files, in this case using recursive search (with the

-r

flag) into the

images

directory.


elmindreda@balthasar~$ duff -r comics
2 files in cluster 1 (43935 bytes, digest ea1a856854c166ebfc95ff96735ae3d03dd551a2)
comics/Nemi/n102.png
comics/Nemi/n58.png
3 files in cluster 2 (32846 bytes, digest 00c819053a711a2f216a94f2a11a202e5bc604aa)
comics/Nemi/n386.png
comics/Nemi/n491.png
comics/Nemi/n512.png
2 files in cluster 3 (26596 bytes, digest b26a8fd15102adbb697cfc6d92ae57893afe1393)
comics/Nemi/n389.png
comics/Nemi/n465.png
2 files in cluster 4 (30332 bytes, digest 11ff80677c85005a5ff3e12199c010bfe3dc2608)
comics/Nemi/n380.png
comics/Nemi/n451.png

The header can be customized (with the

-f

flag) for example outputing only the number of files that follow:


elmindreda@balthasar~$ duff -r -f '%n' comics
2
comics/Nemi/n102.png
comics/Nemi/n58.png
3
comics/Nemi/n386.png
comics/Nemi/n491.png
comics/Nemi/n512.png
2
comics/Nemi/n389.png
comics/Nemi/n465.png
2
comics/Nemi/n380.png
comics/Nemi/n451.png

Excess mode

Duff can report all but one file from each cluster of duplicates (with the

-e

flag). This can be used in combination with for example

rm

to remove duplicates, but should only be done if you don’t care which duplicates are removed.


elmindreda@balthasar~$ duff -re comics
comics/Nemi/n58.png
comics/Nemi/n491.png
comics/Nemi/n512.png
comics/Nemi/n465.png
comics/Nemi/n451.png

Links:

http://duff.dreda.org/

admin