Existem vários códigos que fazem muito deste trabalho para você, por exemplo: fdupes jdupes rdfind duff
Há alguns anos, publiquei execuções de comparação de fdupes e rdfind em
Aqui estão alguns detalhes sobre esses 4:
fdupes finds duplicate files in a given set of directories (man)
Path : /usr/bin/fdupes
Version : 1.51
Type : ELF 64-bit LSB executable, x86-64, version 1 (SYS ...)
Help : probably available with -h,--help
Repo : Debian 8.9 (jessie)
Home : http://code.google.com/p/fdupes/ (pm)
jdupes finds and performs actions upon duplicate files (man)
Path : ~/executable/jdupes
Version : 1.5.1 (2016-11-01)
Type : ELF 64-bit LSB executable, x86-64, version 1 (SYS ...)
Home : https://github.com/jbruchon/jdupes (doc)
rdfind finds duplicate files (man)
Path : /usr/bin/rdfind
Version : 1.3.4
Type : ELF 64-bit LSB executable, x86-64, version 1 (SYS ...)
Repo : Debian 8.9 (jessie)
Home : http://rdfind.pauldreik.se/ (pm)
duff duplicate file finder (man)
Path : /usr/bin/duff
Version : 0.5.2
Type : ELF 64-bit LSB executable, x86-64, version 1 (SYS ...)
Repo : Debian 8.9 (jessie)
Home : http://duff.sourceforge.net/ (pm)
Bes deseja ... felicidades, drl