Re: md5sum lots of files
Grok Mogger <linuximp <at> gmail.com> writes:
> I'd like to cksum or md5sum the files just to
> make sure that they were all copied well. I can't seem to find
> a way to recurse through the directories and do this to a lot of
> files.
There's a package called 'cfv' which can do exactly that. Here's how:
1. make sure the file you're going to use to store the checksums doesn't exist:
$ rm -f /tmp/sums.md5
2. cd into the directory you copied:
$ cd /tmp/old
3. create the checksum file:
$ cfv -C -rr -t md5 -f /tmp/sums.md5
/tmp/sums.md5: 3 files, 3 OK. 0.037 seconds, 2.4K/s
4. cd into the directory you copied to:
$ cd /tmp/new
5. check that the copied files match the originals:
$ cfv -f /tmp/sums.md5
dir2/date3.txt : crc does not match
(1737229c0904a5a4795fd6c2545a7ee9!=f8a99763fdef1273a1abcd8ae63182a0)
/tmp/sums.md5: 3 files, 2 OK, 1 badcrc. 0.010 seconds, 8.5K/s
I copied /tmp/old to /tmp/new and corrupted dir2/date3.txt in the copy. cfv
correctly reports the corrupted file.
Chris.
Reply to: