Unix History: Why does hexdump default to word alignment?

Unix History: Why does hexdump default to word alignment?

Elazar Leibovich elazarl at gmail.com
Thu Dec 1 10:28:07 IST 2011


On Thu, Dec 1, 2011 at 10:10 AM, Nadav Har'El <nyh at math.technion.ac.il>wrote:

>
> When you say "words" and "word aligned" here, you mean historic 2 byte
> words.
>

Indeed. Is there any other meaning for "word" other than two bytes?


> This is indeed *NOT* a very useful default on any modern computers. In some
> old computers, like the PDP11 2 byte words were common and useful.
>

I'm still not convinced that it was a useful default. Since C which is the
lingua fanca of Unix was clearly bytes based.


> I guess nobody cares because since the 1970s when these tools were
> written, nobody uses them any more ;-) I don't think I used "od" in at
> least two decade...


Well, I use them if I need to quickly inspect a file in binary format when
I'm already using the command line. Say, I'm having a unit test that
implements a binary protocol, and I want to verify with my eyes that I'm
getting the right results. ./generate_msg | hexdump -C is quicker than
./generate_msg >tmp && sane_hex_editor tmp. How do you do that without
hexdump, if you actually have this need at all.

But maybe it's just a bad old habit of mine. I guess that if you get used
to a more modern workflow, you can make using modern tools to inspect the
same data just as quickly. As you can understand, less will not help me
with that.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.cs.huji.ac.il/pipermail/linux-il/attachments/20111201/e3995c84/attachment.html>


More information about the Linux-il mailing list