From Bugzilla Helper: User-Agent: Mozilla/4.75 [en] (X11; U; Linux 2.2.16-22 i686) Description of problem: Due to endianity, a hexdump of words usually means the bytes in a file get swapped around when hexdump prints words, in an order like 2211 4433 6655... which requires hopping over the numbers in a hard-to-do-well scheme. Please allow for a byte-by-byte hexdump option in addition to current dumping options; hexdumps can now only made per word. How reproducible: Always Steps to Reproduce: bash$ uname -m i586 bash$ echo "ABCD" | hexdump bash$ echo -n "ABCD" | hexdump 0000000 4241 4443 0000004 bash$ Actual Results: See what I entered between the commandlines. Expected Results: bash$ echo -n "ABCD" | hexdump 0000000 41 42 43 44 0000004 bash$ echo -n "ABCD" | hexdump -x 0000000 4241 4443 0000004 Additional info: The -x option now is doing nothing, it just confirms the default word-printing. Perhaps the default should be byte-by-byte, to make the hexdump more trustworthy when parsing files? Application I was working on: mastering the format of PGP files, as specified in RFC2440. In the past, the same problem showed up when parsing DNS message packets.
You can do all this with format strings. A crude example: hexdump -e '8/1 "%02x " "\n"' /foo/bar If you want an option added to make this more convenient, please talk to the util-linux maintainers (util-linux.no). I would guess that there is not a huge demand for it