md5sum is a shell command in Linux/Unix. It can be used for file verification, such as comparing whether two files are the same. We have the most attentive tutorials. Today, Huajun editor will share with you how to use the md5sum command to compare files in Linux/Unix. Tutorial on the md5 value method, friends who love PS, please check it out!
Recommended: Ubuntu gnome 32-bit standard version download
1. Introduction
The MD5 algorithm is often used to verify the integrity of network file transmissions and prevent files from being tampered with. The full name of MD5 is Message-Digest Algorithm 5. This algorithm calculates information of any length bit by bit to generate a "fingerprint" (or fingerprint) with a binary length of 128 bits (hexadecimal length is 32 bits). (called "message digest"), the possibility that different files produce the same message digest is very, very small.
On Linux or Unix, md5sum is a tool program used to calculate and verify file message digests. Generally speaking, after installing Linux, there will be the tool md5sum, which can be run directly in the command line terminal.
2. Command format
md5sum [OPTION]. . . [FILE]. . .
3. Command options
-b or --binary: Treat the input file as a binary file.
-t or --text: Treat the input file as a text file (default).
-c or --check: used to read md5 information from the file to check the consistency of the file. (If I don’t go into details, see info)
--status: This option is used together with check. During check, no output is output, but the check result is expressed based on the return value.
-w or --warn: During check, check that the input md5 information does not contain illegal lines, and if so, output the corresponding information.
4. Example
(1) Produce the md5 value of a file, as shown in the figure below
(2) Check whether the two files are the same by comparing the md5 values of the two files.
(3) Determine whether a file has been modified by md5
The above is the introduction of the Linux/Unix method of using md5sum to compare whether two files are the same as summarized by Huajun editor. This article uses this example to illustrate the use of the md5sum command. This command can also be used to create md5 codes.