• Post Reply Bookmark Topic Watch Topic
  • New Topic

duplicate file?

 
Ajeesh Moidutty
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am writing an application to find duplicate files which are
existing in same or different names.

How can i compare files?

Checksum or something like that?
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This will only help you if you're on a Unix-ish OS (or on Windows with Cygwin installed), but it is such an amazing one-liner I just have to post it. (I'd like to take credit, but I found it on the 'net).

find / -type f -exec md5sum \{\} \; | gawk '{print $2" "$1}' | sort -k 2 | uniq -D -f 1
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!