I'm trying to get the output of my hexdump command to look similar to hexedit default. I've been playing with the format strings using -e
, but since there are not very good documentation, that visually describe how to use it, I am failing to get it right.
Currently, I have:
# hexdump -C -n 0x100 m1.bin
00000090 00 00 00 00 00 56 08 00 00 00 00 00 04 00 00 00 |.....V..........|
000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
But I would like to have it with one more space separating the 4 bytes, like this:
00000090 00 00 00 00 00 56 08 00 00 00 00 00 04 00 00 00 |.....V..........|
000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
alternatively like this:
00000090 0000 0000 0056 0800 0000 0000 0400 0000 |.....V..........|
000000a0 0000 0000 0000 0000 0000 0000 0000 0000 |................|
Also, if it would be possible to get some color, that would be really great. So far I haven't been able to get any color at all from hexdump.
EDIT
Also great for piping is to leave out address, char field and newlines (\n
) with:
# hexdump -e '16/1 "%04.2x"' -n 40 m1.bin
54 4f 43 00 00 00 00 00 00 00 00 00 00 00 00 ...