hexdump Strangeness

While looking for the magic number on gzipped files I used the hd command which I recently rediscovered from some Linux cheat sheet lying around. By accident, also came across the hexdump command.

Dumping a file with hd access.log.10.gz | head showed:

00000000  1f 8b 08 00 4e 19 42 48  [...]

However, hexdump access.log.10.gz | head resulted in:

0000000 8b1f 0008 194e 4842 [...]

What's that? Different endianness?

Digging reveals that hd is just a symlink to hexdump and the manpage says it uses the -C option. hexdump -C [...] indeed produces the same output as hd [...].

Hmm, a bug in hexdump?