Md5sum

From Wsms

Jump to: navigation, search

Note: This page should be titled md5sum (all lowercase). It is Md5sum due to technical limitations of Mediawiki.

md5sum computes a digest sum. If the md5sum of two different files match, you can be pretty sure that the files have the same contents. Some people prefer the newer sha1sum.

common usage

Compute an md5sum for a file:

[ggeller@localhost 70-270]$ md5sum MCSAMCSE_TK 
7f74d6b7c0c647bec7ab6f220f1d612c  MCSAMCSE_TK

Compute an md5sum for a mounted CD-ROM

[root@localhost 70-270]# md5sum /dev/scd0
7f74d6b7c0c647bec7ab6f220f1d612c  /dev/scd0

Compute md5sums for all files in a directory and save the sums to a file.

ggeller@harrison:~/Desktop/downloads$ md5sum * > MD5SUM.txt

Check the md5sums against those in a file.

ggeller@harrison:~/Desktop/downloads$ md5sum --check MD5SUM.txt 
notes: OK
nxclient_3.0.0-78_i386.deb: OK

Verify that a CD or DVD-ROM was written correctly. Programs like k3b that write the CD often add padding bytes. The trick is to compare the bytes without padding by using only the length of the original iso images. Sometimes you need to be to read the dev files, hence the sudo.

sudo dd if=/dev/cdrom | head -c 682575872 | md5sum

see also

sha1sum
man md5sum
http://twiki.org/cgi-bin/view/Wikilearn/CdromMd5sumsAfterBurning
Linux_commands

Personal tools