Last Updated on
md5sum is used for printing or checking a file's 128-bit MD5 checksum. One can download a file on the Internet and also download its checksum. The md5sum command can, then, be used to verify whether the file has been correctly received. Also, while providing a link for download for a file on a web page, a link to a file containing its checksum is also provided, so that the users can download both and check the file using its checksum.
Checking files using md5 checksum
The command usage is
md5sum -c <checksum_file>
where checksum_file is a specially formatted text file. Each line of <checksum_file> has the following format
<md5sum_checksum> is the md5 checksum,
<space> is the space character, 0x20
N.B.: TWO spaces are required, else you get the undeserved error
no properly formatted MD5 checksum lines found
There should be exactly two spaces, otherwise the error is given.
<file_name> is the file for which this checksum has been given
Generating md5 checksum using md5sum
md5 checksum is generated for a file by the command
md5sum <filename> [ > <checksum_file> ]
<filename> is the file for which md5 checksum is to be computed,
<checksum_file> is the file for in which checksum is to be stored,
Note that the checksum has been redirected to <checksum_file>. If <checksum_file> argument is not given, it is printed on the standard output.