linux – 将文件从给定的’x(起始)偏移复制到给定’y(结束)偏移的工具
发布时间:2020-08-04 01:20:14 所属栏目:Linux 来源:互联网
导读:是否有任何工具可以将文件从给定的起始偏移量复制到给定(结束)偏移量.我还想确认该工具通过运行md5sum正确地复制了指定的字节数.有点像这样 1) Copy source file starting from 100 byte till 250th byte $cp /path/to/source/file /path/to/dest/file -s 100
|
是否有任何工具可以将文件从给定的起始偏移量复制到给定(结束)偏移量.我还想确认该工具通过运行md5sum正确地复制了指定的字节数.有点像这样 1) Copy source file starting from 100 byte till 250th byte
$cp /path/to/source/file /path/to/dest/file -s 100 -e 250
2) Create md5sum of the source file starting from 100byte till 250th byte
$md5sum /path/of/src/file -s 100 -e 250
xxxxxx-xxxxx-xxxxx-xxxx-xx
3) Confirm that destination file created from step 1 is right by comparing the md5sum generated from step 2.
$md5sum /path/of/dest/file
xxxxxx-xxxxx-xxxxx-xxxx-xx
我知道md5sum没有-s和-e的选项,但我想通过给定源文件和目标文件的某些工具来确认.提前致谢 解决方法1)你可以使用dd:# dd if=/path/to/source/file of=/path/to/destination/file bs=1 skip=100 count=250 对于2)我不确定这是否可以通过标准工具实现. [编辑] 啊哈,找到了一条路: 对于2) # dd if=/path/to/source/file bs=1 skip=100 count=250 | md5sum 对于3) md5sum /path/to/destination/file (编辑:长春站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- linux – [01000] [unixodBC] [Driver Manager]无法打开lib
- 实施系统调用时,如何将系统调用号公开给用户区?
- linux – 用于扩展/扩展电子邮件存储服务器的典型方法是什么
- linux – bash导出命令
- LINUX学习:Linux下安装rlwrap工具
- LINUX实战:Linux下正确使用YUM和RPM安装软件
- linux下logrotate配置和理解---转
- linux – 如何在Ubuntu 10.10中的NTFS上运行C二进制文件?
- linux – libtool与64位目标平台上的32位版本的libstdc .so
- linux内核 – 设备驱动程序代码在哪里执行?内核空间还是用
