Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Use this md5sum recipe to confirm the that two directories are exactly the same.

If you are on Mac OS X though , ensure you use brew to instal md5sum first.

...

Verify directory copy by md5 summing each file and then creating a single md5sum from the list.

If you see the error, "find: md5sum: No such file or directory", then you've not installed md5sum properly,

Code Block
languagebash
find -s "source directory" -type f | xargs -I{}-exec md5sum {} > \; | md5sum > source.md5.txt
find -s "target directory" -type f |-exec xargsmd5sum -I{} \; | md5sum {} > target.md5.txt
diff source.md5.txt target.md5.txt

This below from cnet does not work. It returned the error "find: md5sum: No such file or directory" when I ran it against my Apple Photos directory. It looks like it should work. And the answer is md5 sum does not exist by default on Mac OS X.Note this script can be improved to detect failed directory listing.

Another way of doing the same thing,

Code Block
languagebash
find -s "source directory" -type f -exec| xargs -I{} md5sum {} \; | md5sum > > source.md5.txt
find -s "target directory" -type f -exec| xargs -I{} md5sum {} \; | md5sum > target.md5.txt
diff source.md5.txt target.md5.txt

Note this script can be improved to detect failed directory listing.

References

md5 entire folder - http://www.cnet.com/news/how-to-manually-verify-copied-files-in-os-x/

...