Checking File Integrity Using md5sum


Procedure

  1. md5sum /path/to/original/file
  2. md5sum /path/to/new/file
  3. If the outputs match your file is ok

For example I did a file copy with dd of 2 redhat cd's and wanted to make sure that they copied correctly by running md5sum on the /dev/cdrom and then on the file I was able to verify that the copy operation was successful.

Note the following commands and output.

md5sum /dev/cdrom
fe99a43b619e534d0cb0b339a83d18e6  /dev/cdrom

md5sum web/redhat/cd2.iso
fe99a43b619e534d0cb0b339a83d18e6  web/redhat/cd2.iso