How to checksum md5 a file

A file downloaded from internet may have md5 hash for being checked. What is md5 checksum for? I don’t know, I’ve never done it before, but below is how to check it by linux command line.

Compare md5 sum by yourself

Get md5 sum, copy it, open the web page/file that has md5 sum value by web browser and search for the copied text in the web page. If the text is found, then your file’s md5 sum is correct.

Command to get md5 value (for example, of a file named lubuntu-16.04.1-desktop-amd64.iso)

$ md5 lubuntu-16.04.1-desktop-amd64.iso
d2d7edc41ea03998e267db607f92b40d  lubuntu-16.04.1-desktop-amd64.iso

Compare md5 sum Semi-automatically

If you have a file that contains md5 sum (called MD5SUMS) of several files (this file is generated by md5sum command) you can use that file to check md5sum of your download file.

For example, if you download the file lubuntu-16.04.1-desktop-amd64.iso from, there is also a file MD5SUMS there. After downloading the iso file, first wget the MD5SUMS, then run md5sum on it.

$ wget
$ md5sum -c MD5SUMS

Among a bunch of failure messages, you will find one that says your file is OK 🙂

lubuntu-16.04.1-desktop-amd64.iso: OK



Example of what md5 checksum is for

1. To ensure that your large iso file has no data mistake while downloading (it’s bad if you running installation from the iso file, then see an error message that its data is bad).
2. To ensure that you you don’t download a file that has been changed by bad guy (not 100% right 🙂 )

sha1sum and sha256sum

It is said that md5sum is not secure anymore. There are SHA1SUM and SHA256SUM that are better. The usage is the same as above

$ wget
$ sha1sum -c SHA1SUMS
$ wget
$ sha256sum -c SHA256SUMS

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: