Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there any way to change the default line length for the od and hexdump commands? Can't see anything apropriate in the man pages.

share|improve this question
up vote 1 down vote accepted

od has the --width=N argument, which you can use to choose how many bytes per line, perhaps that's what you're looking for? hexdump has a -e FORMATSTRING which has promise, but I've never played too much with it.

share|improve this answer
hey thanks for the tip about width in od, my man pages didn't have that! – newenglander May 4 '12 at 22:05
@newenglander as mentioned under SEE ALSO you should also check info coreutils 'od invocation'. – Thor May 4 '12 at 22:09
With anything GNU, it's always a good idea to check the info page. It has much more information. – jsbillings May 4 '12 at 22:09
Thanks for the extra tip, my SEE ALSO only had hexdump(1), strings(1). – newenglander May 4 '12 at 22:15
Calling info coreutils 'od invocation' on my systems (Mac OS X, FreeBSD) gives me the message No menu item 'coreutils' in node '(dir)Top'. But I did try it on Linux and it was indeed more helpful (but then again so was the man page on that system). – newenglander May 6 '12 at 14:37

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.