Md5sum command
From NetworkCommands
A command available on most Linux platforms; used to generate and display or check the MD5 message digest (or checksum) of one or more files.
Contents |
Usage Syntax
md5sum [options] [path/]filename
Common options include;
- -b - read files in binary mode
- -t - read files in text mode (this is the default)
- -c - check against a given list contained within the specified filename
- --status - only display a status code on success
- -w - display warnings about improperly formatted checksum file lines
filename is either the file that you wish to generate and display a checksum for, or a file containing a list of checksums and filenames that you wish to check.
Usage Examples
md5sum test.txt - compute and display the MD5 checksum for file test.txt
md5sum --check -w checksums.txt - check the checksums of the files and associated checksums listed in file checksums.txt and warn if lines in checksums.txt are improperly formatted
Usage Notes
The --status and -w options are only relevant when -c is used.
Here's an example checksum list file:
866d94ae4a32e879d9ef9766ef6ff60d test.txt 763e64ea86237232863fde9fc0c4b9ec *test2
The * indicates a binary file
An MD5 checksum is always 128bits (or 16Bytes.)
Linux Usage Notes
With most Linux or Unix commands;
- Brief help can be displayed using the option/keyword: -h or --help, for example: chmod --help
- A full command manual can be displayed using the man command followed by the command name, for example: man chmod
- Sometimes 'info' pages are used instead of or to provide more information than man pages; for example: info chmod
- Version information can be display using the option/keyword: -v or --version, for example: chmod --version
Typical Output
[user@test] ~ # md5sum test.txt
866d94ae4a32e879d9ef9766ef6ff60d test.txt
[user@test] ~ # md5sum test2.txt
763e64ea86237232863fde9fc0c4b9ec test2.txt
[user@test] ~ # more checksums.txt
866d94ae4a32e879d9ef9766ef6ff60d test.txt 763e64ea86237232863fde9fc0c4b9ec test2.txt
[user@test] ~ # md5sum --check -w checksums.txt
test.txt: OK test2.txt: OK
Related Files
md5sum is normally located here: /usr/bin/md5sum
Related Commands
The sha1sum command performs the same function for SHA1 message digests.
The OpenSSL dgst command performs the same function while also supporting many other digests.
Related Articles
Information on other Linux commands
Information on other Secure Platform commands
Information on F5 BigIP commands
Information on Cisco commands
Information on Vyatta commands
Information on Extreme commands
Information on Blue Coat SGOS commands
Information on Nokia IPSO commands







