md5值校验

使用哈希的md5给文件加指纹,如果文件被更改,指纹信息就会不匹配,从而确定文件的原值是否被改动。

[root@b test]# md5sum a.txt > zhiwen.txt
[root@b test]# md5sum -c zhiwen.txt    #-c参数检查文件指纹有没有发生变化
a.txt: OK
[root@b test]# echo aa >> a.txt
[root@b test]# md5sum -c zhiwen.txt
a.txt: FAILED
md5sum: WARNING: 1 computed checksum did NOT match

猜你喜欢

转载自www.cnblogs.com/xiaofeng666/p/11091279.html