将十六进制数据读入较少 [英] Read hex data into less

查看:157
本文介绍了将十六进制数据读入较少的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想给一个大数据文件< less -s -M + Gg ,这样读取给定数据的当前读取少于-s -M +千兆克

While循环示例(请参阅ntc2的答案) /stackoverflow.com/a/19871578/54964\">here 。
用一个二进制文件替换 yes ,二进制文件转换为二进制ascii和十六进制:

 ,同时读取-u 10 p || [[-n $ p]]; do 
hexdump -e'/ 4%08x\\\
'{$ p} \
\
| less -s -M + Gg
done 10< / Users / masi / Dropbox / 7-8 \:2015 / r3.raw

其中循环基于此主题此处

你怎么能把这些数据读得更少?

解决方案

我不明白这个例子的细节,但我想你想把少于循环外部,如下所示:

  while read -u 10 p || [[-n $ p]]; 
hexdump -e'/ 4%08x\\\
'{$ p}
done 10


I want to give a big data file to less -s -M +Gg such that read current given data in less -s -M +Gg.

While-loop example (see ntc2's answer)

Less command explained here. Replacing the yes by a binary file which is converted to binary ascii and hex:

while read -u 10 p || [[ -n $p ]]; do
    hexdump -e '/4 "%08x\n"' {$p}                       \
                                                        \
    | less -s -M +Gg
done 10</Users/masi/Dropbox/7-8\:2015/r3.raw

where the looping is based on this thread here.

How can you read such data into less?

解决方案

I don't understand the details of the example, but I think you want to put the less outside of the loop, like this:

while read -u 10 p || [[ -n $p ]]; do
    hexdump -e '/4 "%08x\n"' {$p}
done 10</Users/masi/Dropbox/7-8\:2015/r3.raw | less -s -M +Gg

这篇关于将十六进制数据读入较少的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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