md5sum is a useful tool to verify if the file you downloaded from somewhere is correct
It compute and check MD5 message digest.
$md5sum -b mhvtl-2013-08-29.tgz
md5sum checksum verify
If you have a md5sum checksum, like this
Then you can verify file's checksum
$md5sum -c mhvtl.md5
md5sum verify a list of files
If you have a list of file with their correct checksum in the file, the following command will report if there is file corrupted
$md5sum -c --quiet md5.lst
md5sum: WARNING: 1 of 74 computed checksums did NOT match
$echo -n "I love dog, I love cat, I love both of them" |md5sum
Note: '-n' option is needed, otherwise, an 'Ctrl+C' will be included in the string.
$echo "I love dog, I love cat, I love both of them" |md5sum
I love dog, I love cat, I love both of them
However, when using stand input to generate a string checksum, use Ctrl+D to end the string input
More for md5sum
md5sum [OPTION]... [FILE]...
Print or check MD5 (128-bit) checksums. With no FILE, or when FILE is -, read standard input.
-b, --binary read in binary mode
-c, --check read MD5 sums from the FILEs and check them
-t, --text read in text mode (default)
Note: There is no difference between binary and text mode option on GNU system.
The following three options are useful only when verifying checksums:
--quiet don’t print OK for each successfully verified file
--status don’t output anything, status code shows success
-w, --warn warn about improperly formatted checksum lines
--help display this help and exit
--version output version information and exit
The sums are computed as described in RFC 1321. When checking, the input should be a former
output of this program. The default mode is to print a line with checksum, a character
indicating type (‘*’ for binary, ‘ ’ for text), and name for each FILE.
There is no different between -b and -t on GNU system.