Md5sum
From Wikipedia, the free encyclopedia
- The correct title of this article is md5sum. The initial letter is shown capitalized due to technical restrictions.
md5sum is a computer program which calculates and verifies MD5 hashes. It is commonly used to verify the integrity of files. It is installed by default in most Unix, Linux and BSD operating systems. Versions for Microsoft Windows do exist (see external links).
[edit] Usage
To calculate the MD5 hash of a file under many Unix and Linux operating systems, simply give the filename as an argument to md5sum
(the following commands are not applicable to Windows XP).
$ md5sum somefile 76c6dafd6569222312357fdfdbace3e5 somefile
You can then compare the MD5 hash of your file, to the known good hash of the file you are checking. If the two values match, you have an exact copy of the original file.
The output of md5sum
can be saved into a text file and used to verify the integrity of a file. If the output above is stored in the file somefile.md5
, the following command will compare the MD5 hash of somefile
with the hash stored in somefile.md5
.
$ md5sum -c somefile.md5 somefile: OK
The md5sum
command can also be used in an interactive mode to calculate the MD5 hash of any arbitrary string of characters. After typing the md5sum
command without any arguments, type the string of characters in the terminal. End the string with an End-of-file character. The MD5 hash will be displayed on the terminal next to the input string. For example:
$ md5sum somestring CTRL+D CTRL+D
will result in the following output.
$ md5sum somestring1f129c42de5e4f043cbd88ff6360486f -
Microsoft offers an unsupported tool "Microsoft File Checksum Integrity Verifier" for Windows platform.