Script to Compare Multiple Files.

Hello Everyone,

I have strange situation and unable to think of a solution. Situation is as follow,

FolderA contrain following files,

File1
File2
File3
File4

I want to compare as follow
compare File1 with File2 --> Result Same/Diffrent
compare File1 with File3 --> Result Same/Diffrent
compare File1 with File4 --> Result Same/Diffrent

Then Same loop for file 2,
compare File2 with File1 --> Result Same/Diffrent
compare File2 with File3 --> Result Same/Diffrent
compare File2 with File4 --> Result Same/Diffrent

The end result is to find out how many files contains the same data, so can be merged togather, or their filesname can be extracted in another file.

Hope it makes sense. Appriciate any help i can get.

Thanks & Regards,

You can solve this in two ways.

find md5sum for all the files, and whose md5sum are same, the contents could also be the same.

md5sum *

Or try this tool in sourceforge, finddup,
finddup | Get finddup at SourceForge.net

This might have some bugs, but anyway this could find out and tell you the duplications...