Title: Use md5sum to verify saved files
Author: Sandro Tosi
Last modified: 2007-01-06
A typical task is store some old files (but still important) on some
removable medias (such as USB sticks, DVDs/CDs, external hd. etc).
Since they are important docs, you'd like to have a way to assure
yourself when you'll read a doc back again, it will be the same you've
stored. This can be accomplished with md5sum.
First of all, create the md5 hash for every file you're interested in:
$ md5sum * > md5_hashes_file
then store this file both on your hd and on the removable media.
Then, when you'll want to verify removable media files integrity,
simply exec (from inside removable media):
$ md5sum * | md5sum --check /path/to/md5_hashes_file
md5sum will print a line for every file with OK or KO at the end, to
indicate it's the original file or it's corrupted.