Endianness in Unix hexdump Endianness in Unix hexdump unix unix

Endianness in Unix hexdump


I don't know that it can be done with hexdump, but it's easy enough in perl:

$ printf '\x00\x50' | perl -nE 'say unpack "S>"'80$ printf '\x00\x50' | perl -nE 'say unpack "S<"'20480

You can tweak that to get the format you desire. ('say'requires perl 5.10. Use print for perl < 5.10)

(To clarify for the person who wishes to downvote because I didn't"answer the question". I'm suggesting that the OP replacehexdump with perl. Downvote if you must.)