Linux md5sum command

Updated: 07/12/2017 by Computer Hope

About mesg

The md5sum command computes and checks the MD5 message digest.


Print or check MD5 (128-bit) checksums. With no FILE, or when FILE is -, read standard input.

Note: The MD5 algorithm should not be used any more for security related purposes. Instead, better use an SHA-2 algorithm, implemented in the programs sha224sum, sha256sum, sha384sum, and sha512sum.

md5sum syntax

 md5sum [OPTION]... [FILE]...


-b, --binary Read in binary mode.
-c, --check Read MD5 sums from the FILEs and check them.
--tag Create a BSD-style checksum.
-t, --text Read in text mode (default).

Note: There is no difference between binary and text mode option on GNU system.

The following four 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.
--strict Exit non-zero for improperly formatted checksum lines.
-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 input mode ('*' for binary, space for text), and name for each FILE.

md5sum examples

md5sum example.iso

Running the above command would give the md5 checksum of the example.iso file in the current directory. Below is an example of how the output may appear with the full md5 checksum followed by the file name.

d41d8cd98f00b204e9800998ecf8427e example.iso

sha224sum — Checks the SHA224 message digest.
sha256sum — Checks the SHA256 message digest.
sha384sum — Checks the SHA384 message digest.
sha512sum — Checks the SHA512 message digest.