1

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?

OS=Windows

Mr Shoubs
  • 363
  • 2
  • 9
  • 32

1 Answers1

2

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.

John Gardeniers
  • 27,458
  • 12
  • 55
  • 109
Sirex
  • 5,499
  • 2
  • 33
  • 54
  • 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 06 '11 at 10:27
  • Hmmm. to me that's filed under "here be dragons" :) http://www.pc-tools.net/win32/md5sums/ for the md5 bit, dunno about grep equivalent in windows. http://gnuwin32.sourceforge.net/packages/grep.htm maybe. – Sirex Jun 06 '11 at 10:30
  • 1
    The idea was sound, I found something called md5deep that worked for me. – Mr Shoubs Jun 06 '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 06 '11 at 12:48
  • Cygwin has all these utilities. I recommend it to every windows power user. – LatinSuD Jun 06 '11 at 12:52