tags:

views:

23

answers:

1

Is there a program, or a script out there that can compare the md5 checksum of files I tried to create my own, but i'm having problems with any files that have a space in them, so I was wondering if it'd be easier to just use an application. md5deep is something I downloaded that returns the checksum.

rm md5mastervalue
for i in `ls /media/disk`; do md5deep -rb /media/disk/$i >> md5mastervalue; done
for d in 1 3 ; do cp -rf /media/disk/ /media/disk-$d &  done
wait
rm md5valuet1
rm md5valuet3 
for k in `ls /media/disk`
do
    for f in 1 3; do md5deep -rb /media/disk-$f/$k >> md5valuet$f; done
done
for n in 1 3; do diff md5mastervalue md5valuet$n; done
echo Finished
+1  A: 

are you on linux? if so, you can use md5sum, or sha512sum (better security). Example, create a base line of your files

$ sha512sum * > baseline.txt

then, the next time you want to check, just use -c option, eg

$ sha512sum -c baseline.txt
ghostdog74
Well, the reason I didn't use the md5sum is because it didn't work recursively, which md5deep does, all that code will work fine for any files that do not have any spaces in them
shanghaiguy
it is not difficult to use it recursively, just combine it with `find`, or do a normal shell version using globstar with for loop (bash 4.0).
ghostdog74