In shell, how can I read the bytes of a binary file I have, and print the output as hexadecimal numbers?
Tell me more
×
Unix & Linux Stack Exchange is a question and answer site for
users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.
|
Use
... |
|||||||||||
|
|
My two cents:
I like this because you are tailing a currently buffering file while being able to see the hexdump live. Don't forget that EVERYTHING in Unix is a file and we can easily chain commands like |
||||
|
|
The midnight commander is another option. I don't know whether it is available for all unix flavors. You might need to download it first. |
|||
|
|
|
While we're on
Sample output:
Or, if you want to read the bytes one at a time and print them in your own format, try something like:
Sample output:
|
|||||
|
|
Another option is od:
or
|
|||||||||||||
|