如何从文件中提取单个字节块? [英] How do I extract a single chunk of bytes from within a file?

查看:95
本文介绍了如何从文件中提取单个字节块?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Linux桌面(RHEL4)上,我想从大文件(> 1 Gig)中提取一定范围的字节(通常小于1000).我知道文件的偏移量和块的大小.

On a Linux desktop (RHEL4) I want to extract a range of bytes (typically less than 1000) from within a large file (>1 Gig). I know the offset into the file and the size of the chunk.

我可以编写代码来执行此操作,但是有命令行解决方案吗?

I can write code to do this but is there a command line solution?

理想情况是:

magicprogram --offset 102567 --size 253 < input.binary > output.binary

推荐答案

尝试dd:

dd skip=102567 count=253 if=input.binary of=output.binary bs=1

这篇关于如何从文件中提取单个字节块?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆