Md5sum
Usage: md5sum [options] ... [File] ...
Displays or checks the MD5 (128-bit) checksum.
If there is no file option, or if the file is "-", read from the standard input.
-B,--binary read in binary mode
-C,--check read the MD5 checksum from the file and check it
-T,--text read in plain text mode (default)
The following three options are useful for checksums:
--quiet file output is not successful for validation ok
--status does not output any content, displays success using exit status number
-W,--warn warning of malformed checksum rows
--strict with--check, exit Non-zero for any invalid input
--HELP displays this help information and exits
--version display version information and exit
Checksums are generated in accordance with the RFC 1321 specification. When checking, the input format given should and the output of the program
Boilerplate format is the same. The default output mode outputs a checksum of one line checksum, and has a character
Represents a file type ("*" represents a binary, "" represents plain text), and displays the name of each file at the same time.
Example 1
The code is as follows:
[Root@linux ~]# md5sum-b Test #以二进制进行读取
832df9d3d18471d80d67bee644eebb8a *test
Example 2
The code is as follows:
[Root@zhangwei scripts]# md5sum zzz > ZZZ.MD5 # Generate MD5 encryption test and
[Root@zhangwei scripts]# md5sum-c ZZZ.MD5 # Inspection is consistent with the file,
Sha1sum
Sha1sum a unique hash algorithm for a file,
Usage: sha1sum [OPTION] [FILE] ...
Parameters:
-B,--binary binary mode read
-C,--check check file according to SHA1 num
-T,--text text mode read (default)
Cases:
The code is as follows:
[SHA1 value of Root@localhost ~]# sha1sum install.log #install. Log
0750a96a87738a2d2173bbee12e40e6ab17136c6 Install.log
The code is as follows:
[Root@localhost ~]# sha1sum-b Install.log #二进制模块读取
0750a96a87738a2d2173bbee12e40e6ab17136c6 *install.log
The code is as follows:
[root@localhost ~]# sha1sum install.log > AA
[root@localhost ~]# sha1sum-c aa #根据sha1值, check file
Install.log:OK