Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use the md5sum command in Linux

2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces how to use the md5sum command in Linux, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, let the editor take you to understand it.

The md5sum command uses the MD5 message digest 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.

Syntax # md5sum (option) (parameter) option-b or-- binary: treat the input file as a binary file. -t or-- text: treats the input file as a text file (default). -c or-- check: used to read md5 information from a file to check file consistency. (see info without details)-- status: this option, used with check, does not output in check, but represents the check result based on the return value. -w or-- warn: in check, check that the input md5 information has no illegal lines, and if so, output the corresponding information. Parameter file: specify a text file that holds the file name and checksum example 1) View the MD5 value of a string online view the MD5 value address of the string: the MD5 values viewed in the https://md5jiami.51240.com/ linux terminal are all in 32-bit lowercase format

[root@web-master ~] # echo-n "hello world" | md5sum 5eb63bbbe01eeed093cb22bb8f5acdc3-[root@web-master ~] # echo-n "hello world" | md5sum | cut-d ""-F1 5eb63bbbe01eeed093cb22bb8f5acdc3 command explains: md5sum: display or check the MD5 (128-bit) checksum. If there is no file option, or the file is "-", it will be read from standard input. Echo-n: newline characters are not printed. (note: the-n parameter after echo-n must be added so that the MD5 value of the calculated string is correct.) cut: cut is used to cut columns or fields from standard input or text files. Cut text to paste it into a text file. -d specifies a different field delimiter from the space and tab keys. -F1 represents the first domain.

2) View the MD5 value of a file

[root@web-master ~] # echo "test md5" > kevin.sql View and get the MD5 value of this file [root@web-master ~] # md5sum kevin.sql 170ecb8475ca6e384dbd74c17e165c9e kevin.sql [root@web-master ~] # md5sum kevin.sql | cut-d ""-F1 170ecb8475ca6e384dbd74c17e165c9e produces the MD5 value of this file [root@web-master ~] # md5sum kevin.sql > kevin.sql.md5 to check whether the two files are the same You can compare the MD5 values of the two files (you can use this method later to verify that the kevin.sql file has been modified). [root@web-master ~] # md5sum kevin.sql 170ecb8475ca6e384dbd74c17e165c9e kevin.sql [root@web-master ~] # cat kevin.sql.md5 170ecb8475ca6e384dbd74c17e165c9e kevin.sql displays details

3) judge whether a file is modified or not, and judge by md5

Thank you for reading this article carefully. I hope the article "how to use md5sum commands in Linux" shared by the editor will be helpful to everyone. At the same time, I also hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

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.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report