In linux or Unix, md5sum is a tool program used to calculate and verify the file message digest. let's take a look at several examples.
1. Introduction
The MD5 algorithm is often used to verify the integrity of network file transmission and prevent file tampering.The full name of MD5 is the Message Digest Algorithm (Message-Digest Algorithm 5). This Algorithm computes information of any length by bit, generate a "fingerprint" (or "message digest") with a binary length of 128 bits (32 bits in hexadecimal format "), different files may generate the same message digest.
In linux or Unix, md5sum is a tool program used to calculate and verify the file message digest. Generally, after Linux is installed, the md5sum tool runs directly on the command line terminal.
2. command format
Md5sum [OPTION]... [FILE]...
3. command options
-B or -- binary: treats the input file as a binary file.
-T or -- text: view the input file as a text file (default ).
-C or -- check: used to read md5 information from the file to check file consistency. (For more information, see info)
-- Status: This option is used with check. the check result is displayed based on the returned value instead of output during check.
-W or -- warn: check whether the input md5 information is invalid during check. If yes, the corresponding information is output.
4. example
(1) generate the md5 value of a file, as shown in
(2) Check whether the two files are the same. you can compare the md5 values of the two files.
(3) determine whether a file is modified and use md5 to determine