Read hex data into less

2020-02-13 06:42发布

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?

标签: hex less hexdump
1条回答
smile是对你的礼貌
2楼-- · 2020-02-13 07:16

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
查看更多
登录 后发表回答