Read hex data into less

1.7k views Asked by At

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?

1

There are 1 answers

1
ntc2 On BEST ANSWER

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