Md5 file check whether the linux system file is changed
Source: Internet
Author: User
Check whether the linux system file has been changed by using md5sum. Export lsfirst.txtgrouppasswdsecond.txtthird.txt # pwd/mnt/tt # md5sum/mnt/tt/* & gt;/opt/md5_res.txt \ perform md5 verification on the files in the tt directory and store the data... check whether the linux system file has been changed by using md5sum.
# Ls
First.txt group passwd second.txt third.txt
# Pwd
/Mnt/tt
# Md5sum/mnt/tt/*>/opt/md5_res.txt \ perform md5 verification on the files in the tt directory, and store the data to a file
1. if the files in the tt directory are not modified:
# Md5sum-c/opt/md5_res.txt
/Mnt/tt/first.txt: OK
/Mnt/tt/group: OK
/Mnt/tt/passwd: OK
/Mnt/tt/second.txt: OK
/Mnt/tt/third.txt: OK
2. if you modify the sedond.txt file under the ttdirectory
# Md5sum-c/opt/md5_res.txt
/Mnt/tt/first.txt: OK
/Mnt/tt/group: OK
/Mnt/tt/passwd: OK
/Mnt/tt/second.txt: FAILED
/Mnt/tt/third.txt: OK
Md5sum: WARNING: 1 of 5 computed checksums did NOT match
In this way, you can see which file has been changed.
If you really want to use verification, you have to ensure that each operation, the data storage file must be updated in a timely manner.
Md5sum syntax:
-C, -- check
Read MD5 sums from the FILEs and check them
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.