微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

将文件从给定'x'开始偏移量复制到给定'y'结束偏移量的工具

是否有任何工具将文件从给定的起始偏移量复制到给定(结束)偏移量。 我也想确认该工具通过运行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的选项,但是我想通过一些给定源文件和目标文件的工具来确认。 提前致谢

我需要debuggingpthreads?

通过在LINUX中使用C ++,显示文件包含在特定目录中

在Linux上相当于SetPriorityClass

C ++和Xlib – 中心窗口

如何做“每个”从输出发现?

对于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

dd if=/path/to/source/file of=/path/to/destination/file bs=1 skip=100 count=250

将从偏移量100(直到第350字节)复制250个字节 – 如果要将字节从100复制到250,则应该这样做

dd if=/path/to/source/file of=/path/to/destination/file bs=1 skip=100 count=150

它会复制150个需要的字节。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐