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 MD5 code and SHA1 code of check file in Linux

2025-01-20 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article introduces the relevant knowledge of "how to use the MD5 code and SHA1 code of the check file in Linux". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Md5sum

Usage: md5sum [option]. [file].

Displays or checks the MD5 (128-bit) checksum.

If there is no file option, or if the file is "-", it is read from standard input.

-b,-- binary reads in binary mode

-c,-- check reads the check value of MD5 from the file and checks it

-t,-- text reads in plain text mode (default)

The following three options are useful for verification:

-- quiet does not output OK for files with successful verification

-- status does not output anything and uses the exit status number to display success

-w,-- warn warns against inaccurately formatted checksum lines

-strict with-check, exit non-zero for any invalid input

-- help displays this help and exits

-- version displays version information and exits

Checksums are generated according to the RFC 1321 specification. When checking, the input format given should match the output of the program

The template format is the same. The default output mode outputs an one-line checksum checksum, with a character to

Represents the file type ("*" for binary, "" for 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 # reads in binary

832df9d3d18471d80d67bee644eebb8a * test

Example 2

The code is as follows:

[root@zhangwei scripts] # md5sum zzz > zzz.md5 # generate md5 encryption check and

[root@zhangwei scripts] # md5sum-c zzz.md5 # check whether it is consistent with the file

Sha1sum

Hash algorithm for unique verification of files by sha1sum

Usage: sha1sum [OPTION] [FILE].

Parameters:

-b,-- binary binary mode read

-c,-- check checks the file according to sha1 num

-t,-- text text mode read (default)

Example:

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 # binary module read

0750a96a87738a2d2173bbee12e40e6ab17136c6 * install.log

The code is as follows:

[root@localhost ~] # sha1sum install.log > aa

[root@localhost ~] # sha1sum-c aa # check the file according to SHA1 value

Install.log: OK

This is the end of the content of "how to use MD5 code and SHA1 code of check file in Linux". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

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

Servers

Wechat

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

12
Report