In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "how to use the md5sum command of Linux". The content of the explanation is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn how to use the md5sum command of Linux.
Linux common command md5sum command uses MD5 message summary algorithm (128bit) to calculate and check the checksum of the file. Generally speaking, after Linux is installed, there will be a md5sum tool that runs directly on the command line terminal.
A tool program for md5sum to calculate and verify the summary of file messages
It is added that the MD5 algorithm is often used to verify the integrity of network file transmission and prevent files from being tampered with. The full name of MD5 is message digest algorithm (Message-Digest Algorithm 5). This algorithm calculates any length of information bit by bit and produces a "fingerprint" (or "message digest") with a binary length of 128bits (hexadecimal length is 32 bits). The possibility that different files produce the same message digest is very small.
Syntax md5sum (option) (parameter) option-b: read the file in binary mode;-t or-- text: treat the input file as a text file;-c: read the MD5 checksum from the specified file and verify it;-- status: do not output any information when the verification is successful;-w: give a warning when the check is incorrect. Parameter file: specifies a text file that holds the file name and checksum.
An instance uses md5sum to generate a password
Another way to get a random string that can be used as a password is to calculate the MD5 check value! The check values do look like random strings that we can use as passwords. Make sure that your calculation source is a variable so that the check value generated is different each time you run the command. Like date! The date command always produces different output.
[root@localhost ~] # date | md5sum 6a43f2c246cdc3e6a3592652f831d186-generates the MD5 value of a file insert.sql:
[root@localhost ~] # md5sum insert.sql bcda6cb5c704664f989703ac5a88f112 insert.sql check whether the file testfile has been modified:
First generate the md5 file:
Md5sum testfile > testfile.md5 check:
Md5sum testfile-c testfile.md5 if the file has not changed, the output should be as follows:
Forsort: OK at this point, the md5sum command returns 0.
If the file changes, the output should be as follows:
Forsort: FAILED md5sum: WARNING: 1 of 1 computed checksum did NOT match at this time, the md5sum command returns non-zero.
Here, the file name used for the check is arbitrary. If you don't want any output, then md5sum testfile-- status-c testfile.md5, which detects the result by returning a value.
The option to output information if the detection file is illegal during detection:
After the md5sum-w-c testfile.md5 output, the file exception output looks like this:
Md5sum: testfile.md5: 1: improperly formatted MD5 checksum line md5sum: testfile.md5: no properly formatted MD5 checksum lines found here, testfile.md5 has only one line of information, but I think it is illegal by adding an extra character to it. If the md5 file is normal, then-w is the same.
Thank you for your reading, the above is the content of "how to use the md5sum command of Linux". After the study of this article, I believe you have a deeper understanding of how to use the md5sum command of Linux, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.