Docu review done: Mon 03 Jul 2023 16:34:12 CEST

fdupes

Table of Content

General

fdupes finds duplicate files in a given set of directories Searches the given path for duplicate files. Such files are found by comparing file sizes and MD5 signatures, followed by a byte-by-byte comparison.

Install

$ apt install fdupes

Parameters

ParametersDescription
-r /path/to/dir1 /path/to/dir2 [/path3,...]for every directory given follow subdirectories encountered within
-R: /path/to/dir1 /path/to/dir2 [/path3,...]for each directory given after this option follow subdirectories encountered within
-sfollows symlinked directoires
-Hnormally, when two or more files point to the same disk area they are treated as non-duplicates; this option will change this behavior
-nexclude zero-length files from consideration
-Aexclude hidden files from consideration
-Sshow size of duplicate files
-msummarize duplicate files information
-qquite
-dprompt user for files to preserve, deleting all others
-Nwhen used together with -d, preserve the first file in each set of duplicates and delete the others without prompting the user
-Idelete duplicates as they are encountered, without grouping into sets; implies -H
-pdon’t consider files with different owner/group or permission bits as duplicates
-o [time/name]order files according to WORD: time - sort by mtime, name - sort by filenam
-ireverse order while sorting
-1outputs each duplicates mach in one line

Examples

# the quer files differes between test1 and test2 dir
$ md5sum test*/*
b026324c6904b2a9cb4b88d6d61c81d1  test1/1
31d30eea8d0968d6458e0ad0027c9f80  test1/10
26ab0db90d72e28ad0ba1e22ee510510  test1/2
6d7fce9fee471194aa8b5b6e47267f03  test1/3
e760668b6273d38c832c153fde5725da  test1/4
1dcca23355272056f04fe8bf20edfce0  test1/5
9ae0ea9e3c9c6e1b9b6252c8395efdc1  test1/6
84bc3da1b3e33a18e8d5e1bdd7a18d7a  test1/7
c30f7472766d25af1dc80b3ffc9a58c7  test1/8
9e6b1b425e8c68d99517d849d020c8b7  test1/9
d8016131a2724252b2419bf645aab221  test1/qwer
b026324c6904b2a9cb4b88d6d61c81d1  test2/1
31d30eea8d0968d6458e0ad0027c9f80  test2/10
26ab0db90d72e28ad0ba1e22ee510510  test2/2
6d7fce9fee471194aa8b5b6e47267f03  test2/3
e760668b6273d38c832c153fde5725da  test2/4
1dcca23355272056f04fe8bf20edfce0  test2/5
9ae0ea9e3c9c6e1b9b6252c8395efdc1  test2/6
84bc3da1b3e33a18e8d5e1bdd7a18d7a  test2/7
c30f7472766d25af1dc80b3ffc9a58c7  test2/8
9e6b1b425e8c68d99517d849d020c8b7  test2/9
2b00042f7481c7b056c4b410d28f33cf  test2/qwer

$ fdupes -ri1 ./test1 ./test2
test2/7 test1/7
test2/9 test1/9
test2/3 test1/3
test2/1 test1/1
test2/2 test1/2
test2/4 test1/4
test2/10 test1/10
test2/6 test1/6
test2/8 test1/8
test2/5 test1/5