Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a folder that has over 1000 text files in it and I need to check if they all have the same contents, they are all the same size so I can't tell that way - does anyone know of a mass file comparison too that will accept many files as an input and highlight any changes that differ from the first file that was loaded?


share|improve this question
up vote 2 down vote accepted

md5sum is probably easiest, then compare the results. You can script this if it's done often but as a one off you can just do the below by hand.

On linux: md5sum [first file]

Take that hash (via copy/paste) and:

md5sum * | sort | grep -v [first hash]

This'll leave anything that has a different hash value.

share|improve this answer
Is there an equivalent in windows, I know I could probably use cgywin, but I hope I could just find an app that I could point to a folder and get what I wanted? – Mr Shoubs Jun 6 '11 at 10:27
Hmmm. to me that's filed under "here be dragons" :) for the md5 bit, dunno about grep equivalent in windows. maybe. – Sirex Jun 6 '11 at 10:30
The idea was sound, I found something called md5deep that worked for me. – Mr Shoubs Jun 6 '11 at 10:39
I'd use rsync (automatically handles recursion) rather than running md5sum repeatedly - but then I don't have to suffer MSWindows on my servers. – symcbean Jun 6 '11 at 12:48
Cygwin has all these utilities. I recommend it to every windows power user. – LatinSuD Jun 6 '11 at 12:52

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.