md5sum For calculating and verifying files MD5 value .
md5sum It is often used to verify the integrity of network file transmission , Prevent documents from being tampered with . In daily work , We can use it to monitor whether important files in the system have been tampered with .
You can also use md5sum Generate the password of the file or user .
md5sum [ Options ] [ file ]
-b # Use binary mode to read files -t # Think of the input file as a text file -c # Read... From the specified file MD5 Check value , And check it --status # When the verification is successful, no information will be output -w # When the verification is not correct, the warning message will be output
Generate passwords or random numbers
[root@centos7 ~]# date | md5sum 1b1f0ba711e7d4931c23fbbd2b328e40 -
Check a file for md5 value
[root@centos7 testdir]# md5sum mingongge1.txt c5cab5a45a72380ce456a4370bf40348 mingongge1.txt
Check whether a file has been changed
# Extract original file md5 value [root@centos7 testdir]# md5sum mingongge1.txt >./mingongge.txt.md5 [root@centos7 testdir]# cat mingongge.txt.md5 c5cab5a45a72380ce456a4370bf40348 mingongge1.txt # Write content [root@centos7 testdir]# cat >> mingongge1.txt << EOF > 1 > 2 > 3 > 4 > EOF [root@centos7 testdir]# md5sum mingongge1.txt -c mingongge.txt.md5 mingongge1.txt: FAILED md5sum: WARNING: 1 computed checksum did NOT match
This article is from WeChat official account. - The road of technology for migrant workers （jishuroad） , author ： Click to follow ????
The source and reprint of the original text are detailed in the text , If there is any infringement , Please contact the email@example.com Delete .
Original publication time ： 2021-01-28
Participation of this paper Tencent cloud media sharing plan , You are welcome to join us , share .