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 md5sum command in Linux system

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

Share

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

Today, I will talk to you about how to use the md5sum command in the Linux system. Many people may not know much about it. In order to make you understand better, the editor has summarized the following for you. I hope you can get something according to this article.

1. Use md5sum to generate fingerprint (message digest) command as follows: md5sum file > file.md5 or md5sum file > > file.md5

Note: the difference between > and > > is that: > means to redirect the summary generated by the file file to the file file.md5, but overwrites the contents of the file.md5, while > > appends the output summary to the back of the file.md5 file. You can also output the message abstracts of multiple files to a md5 file, using the wildcard *. For example, there are several iso documents in a directory. To output the abstracts of these iso files to the iso.md5 file, the command is as follows: md5sum *. Iso > iso.md5.

2. Use md5 newspaper Abstracts to verify files, there are two methods:

1. For example, put the downloaded file file and the file.md5 message summary file of the file in the same directory, and then verify it with the following command: md5sum-c file.md5 and then if the verification is successful, it will output: correct

two。 For example, download the file file, and then run the following command: the md5sum file command will output a message summary of md5, and then compare the summary directly with the content in file.md5. If the same, it means that the verification is correct.

The usage of linux md5sum

Skills for Oracle users

Md5sum is a very powerful command for security enforcement. Some of the configuration files you manage, such as listener.ora, tnsnames.ora, and init.ora, are important for a successful Oracle infrastructure, and any changes can cause downtime. These are usually part of the change control process. Do not believe others that these files have not changed, use the MD5 checksum to execute the command. Create a checksum file and recreate it each time you make a change to the plan. As part of compliance, use the md5sum command to check the file. If someone inadvertently updates one of these important files, you will capture the changes immediately.

Similarly, you can create MD5 checksums for all executables in $ORACLE_HOME/bin and constantly compare them to capture unauthorized changes.

Generate the MD5 value of a file

The code is as follows:

[oracle@node1 bin] $md5sum lsnrctl

87df51eb21ee0643e47988a0d8136f18 lsnrctl

Second, check whether the file has changed.

The code is as follows:

[oracle@node1 ~] $touch file1 file2

[oracle@node1 ~] $ls

File1 file2 patch.log

[oracle@node1 ~] $

[oracle@node1 ~] $md5sum file1 file2 > f1f2

[oracle@node1] $md5sum-- check f1f2

File1: OK

File2: OK

[oracle@node1 ~] $echo "change" > > file1

[oracle@node1] $md5sum-- check f1f2

File1: FAILED

File2: OK

Md5sum: WARNING: 1 of 2 computed checksums did NOT match

Examples are as follows:

Shell

The code is as follows:

# touch f1.txt f2.txt

# ls

F1.txt f2.txt

# md5sum * .txt > md5sumtest.md5

# cat md5sumtest.md5

D41d8cd98f00b204e9800998ecf8427e f1.txt

D41d8cd98f00b204e9800998ecf8427e f2.txt

# echo "" > f1.txt

# md5sum-c md5sumtest.md5

F1.txt: FAILED

F2.txt: OK

Md5sum: WARNING: 1 of 2 computed checksums did NOT match

# echo "" > f2.txt

# md5sum-c md5sumtest.md5

F1.txt: FAILED

F2.txt: FAILED

Md5sum: WARNING: 2 of 2 computed checksums did NOT match

# cat / dev/null > f1.txt

# md5sum-c md5sumtest.md5

F1.txt: OK

F2.txt: FAILED

Md5sum: WARNING: 1 of 2 computed checksums did NOT match

# cat / dev/null > f2.txt

# md5sum-c md5sumtest.md5

F1.txt: OK

F2.txt: OK

The code is as follows:

# touch f1.txt f2.txt

# ls

F1.txt f2.txt

# md5sum * .txt > md5sumtest.md5

# cat md5sumtest.md5

D41d8cd98f00b204e9800998ecf8427e f1.txt

D41d8cd98f00b204e9800998ecf8427e f2.txt

# echo "" > f1.txt

# md5sum-c md5sumtest.md5

F1.txt: FAILED

F2.txt: OK

Md5sum: WARNING: 1 of 2 computed checksums did NOT match

# echo "" > f2.txt

# md5sum-c md5sumtest.md5

F1.txt: FAILED

F2.txt: FAILED

Md5sum: WARNING: 2 of 2 computed checksums did NOT match

# cat / dev/null > f1.txt

# md5sum-c md5sumtest.md5

F1.txt: OK

F2.txt: FAILED

Md5sum: WARNING: 1 of 2 computed checksums did NOT match

# cat / dev/null > f2.txt

# md5sum-c md5sumtest.md5

F1.txt: OK

F2.txt: OK

After reading the above, do you have any further understanding of how to use the md5sum command in the Linux system? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.

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