Linux md5sum 命令
Linux md5sum 命令
通过 Linux 的 md5sum 命令,可以对指定的文件,计算出唯一的一个MD5值(128bit)。
通过比较文件前后的MD5值,可以判断文件是否发生变化(是否被修改过)。
1、md5sum 命令使用方式(通过md5sum --help查看):
Usage: md5sum [OPTION]... [FILE]...
Print or check MD5 (-bit) checksums.
With no FILE, or when FILE is -, read standard input. -b, --binary read in binary mode
-c, --check read MD5 sums from the FILEs and check them
--tag create a BSD-style checksum
-t, --text read in text mode (default)
Note: There is no difference between binary and text mode option on GNU system. The following four options are useful only when verifying checksums:
--quiet don't print OK for each successfully verified file
--status don't output anything, status code shows success
--strict exit non-zero for improperly formatted checksum lines
-w, --warn warn about improperly formatted checksum lines --help display this help and exit
--version output version information and exit The sums are computed as described in RFC . When checking, the input
should be a former output of this program. The default mode is to print
a line with checksum, a character indicating input mode ('*' for binary,
space for text), and name for each FILE. GNU coreutils online help: <http://www.gnu.org/software/coreutils/>
For complete documentation, run: info coreutils 'md5sum invocation'
2、计算一个文件的 MD5 值
1)新建一个文件test.txt,内容为 Hello, md5sum.
使用如下命令,生成改文件对应的 MD5 值:
md5sum test.txt > md5.out
2)此时会在当前目录下看到生成的 md5.out 文件

3)查看改文件对应的 MD5 值
cat md5.out

4)使用如下命令,比较文件的 MD5 值是否发生变化
md5sum -c md5.out

5)当修改test.txt 文件,增加 Modify 单词,再次对比 MD5 值,会发现不一致


6)BSD格式查看 MD5 值
md5sum --tag md5.out

Linux md5sum 命令的更多相关文章
- linux md5sum命令
md5sum命令用于生成和校验文件的md5值 生成文件md5值 [root@cdncenter ~]# ll total -rw-r--r-- root root Oct : .txt -rw-r-- ...
- 【转】linux命令详解:md5sum命令
[转]linux命令详解:md5sum命令 转自:http://blog.itpub.net/29320885/viewspace-1710218/ 前言 在网络传输.设备之间转存.复制大文件等时,可 ...
- linux命令详解:md5sum命令
前言 在网络传输.设备之间转存.复制大文件等时,可能会出现传输前后数据不一致的情况.这种情况在网络这种相对更不稳定的环境中,容易出现.那么校验文件的完整性,也是势在必行的. 使用说明 md5sum命令 ...
- linux命令学习笔记-md5sum 命令详解
前言 在网络传输.设备之间转存.复制大文件等时,可能会出现传输前后数据不一致的情况.这种情况在网络这种相对更 不稳定的环境中,容易出现.那么校验文件的完整性,也是势在必行的. 使用说明 md5sum命 ...
- 爹地,我找到了!,15个极好的Linux find命令示例
爹地,我找到了!, 15个极好的Linux find命令示例 英文原文:Daddy, I found it!, 15 Awesome Linux Find Command Examples 标签: L ...
- 妈咪,我找到了! -- 15个实用的Linux find命令示例
妈咪,我找到了! -- 15个实用的Linux find命令示例 英文原文:Mommy, I found it! — 15 Practical Linux Find Command Examples ...
- linux 常用命令大全
linux 常用命令大全 系统信息 arch 显示机器的处理器架构(1) uname -m 显示机器的处理器架构(2) uname -r 显示正在使用的内核版本 dmidecode -q 显示硬件系统 ...
- linux全部命令
linux全部命令 一.安装和登陆命令1.进入图形界面startx 2.进入图形界面init 5 3.进入字符界面init 3 4.登陆login 5.关机poweroff-p 关闭机器的时候关闭电源 ...
- 73条日常Linux shell命令汇总,总有一条你需要!
转载: 73条日常Linux shell命令汇总,总有一条你需要! 1.检查远程端口是否对bash开放: echo >/dev/tcp/8.8.8.8/53 && echo &q ...
随机推荐
- TCP 的三次握手和四次挥手,TCP 的流量控制和拥塞控制
70.TCP协议的三次握手与四次挥手70.1.TCP报文结构 1.源端口号:表示发送端端口号,字段长为16位. 2.目标端口号:表示接收端口号,字段长为16位. 3.序列号:表示发送数据的位置 ...
- centos openjdk
centos openjdk centos openjdk centos openjdk 切换 java jdk
- bug-- java.lang.RuntimeException: Type “Klass*"
使用jinfo查看jvm进程id为27523的信息 [java@xftest0 ~]$ jinfo 27523 Attaching to process ID 27523, please wa ...
- 第一份c语言作业
2.1 你对软件工程专业或者计算机科学与技术专业了解是怎样? •答案: 软件工程专业是个年轻的专业,紧跟这个信息化的新时代.我学习它是因为感兴趣,经过一周的学习,我了解了一些 该专业课程主要是c语言程 ...
- GET与POST方法和用curl命令执行
1.超文本传输协议 超文本传输协议(HTTP)的设计目的是保证客户机与服务器之间的通信,web 浏览器可能是客户端,而计算机上的网络应用程序也可能作为服务器端. HTTP的工作方式是客户机与服务器之间 ...
- Vue event.stopPropagation()和event.preventDefault()的使用
定义和用法 1. event.stopPropagation()方法 阻止事件冒泡到父元素,阻止任何父事件处理程序被执行,但是它的默认事件仍然会执行.当调用这个方法的时候,如果点击了一个链接(a标签) ...
- keras计算指定层的输出
import keras model = keras.models.Sequential([ keras.layers.Dense(4, activation='relu', input_dim=1, ...
- [Linux]安装kali虚拟机后忘记root密码
1. 登录时,按e进入编辑模式 2. 编辑模式 修改 ro 修改为 rw 添加 init=/bin/bash 修改完按 F10 3. 选择recovery mode 回车 4.输入命令passwd 设 ...
- Mybatis源码学习之事务管理(八)
简述 在实际开发中,数据库事务的控制是一件非常重要的工作,本文将学习Mybatis对事务的管理机制.在Mybatis中基于接口 Transaction 将事务分为两种,一种是JdbcTransacti ...
- scarpy crawl 爬取微信小程序文章(将数据通过异步的方式保存的数据库中)
import scrapy from scrapy.linkextractors import LinkExtractor from scrapy.spiders import CrawlSpider ...