Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Finding files with same size (potential duplicates) in nested sub-folders in Linux Mint shell? [closed]

I have used rdfind, fdupes and fslint and have looked at previous posts such as this one. However the solution in the linked post does't help with files scattered in nested sub-folders. rdfind, fdupes and fslint work well, they removed a lot of duplicate files, but fail to find all of them. I still can see a lot of duplicate files that have exactly the same file size. Is there any way that I can find all files that have the same file size scattered in nested sub-directories of a folder?

like image 895
Sav Avatar asked Sep 13 '25 18:09

Sav


1 Answers

#prefix each filepath with the size of the file padded to 10 places
find . -type f -printf "%10s\t%p\n" | 
sort --numeric | #sort numerically (uniq needs this) 
uniq --repeated --check-chars=10 #select duplicates 

See the respective manpages for more details.

like image 85
PSkocik Avatar answered Sep 16 '25 12:09

PSkocik