Reading an od Dump Down to the Bits
Run od -b on a file and every byte comes back as three octal digits. The habit is older than the byte itself: machines with 12, 18 and 36-bit words split neatly into groups of three bits, so base-8 was the natural shorthand and the Unix tools inherited it. When you need the actual bit pattern behind a dump column, this page unpacks it.
644 becomes 110, 100, 100, so the byte is 110100100 — nine bits, which is why a file mode fits so tidily.Two Places Octal Still Prints
Byte Dumps on the Command Line
od is octal, and plenty of scripts and manual pages still quote bytes that way.Documentation from Older Machines
The expansion is also the clearest way to explain why octal and hex disagree: three bits per digit fits a nine-bit permission set, four bits per digit fits an eight-bit byte, and neither one fits both.
From Dump Column to Bit Pattern
Type one column of the dump
Digits 0 to 7 are the only ones accepted, which catches a misread 8 or 9 before it turns into a wrong answer.
Restore the leading zeros
The bits come back without padding and spaced in fours. For a byte, write the pattern out to eight positions yourself before you compare it with anything.
Take the pattern with you
Copying the binary field returns the bits joined together behind 0b, ready to paste into a calculator, a test case or a comment.
Octal Dumps and Machine Word Bits
The middle column is what this page prints; the one beside it is the same value padded to a full byte, which is how the data actually sits on disk.
| od column | Output here | Padded byte | Meaning |
|---|---|---|---|
007 | 111 | 00000111 | Bell character |
012 | 1010 | 00001010 | Line feed |
040 | 100000 | 00100000 | Space |
101 | 1000001 | 01000001 | Capital A |
200 | 10000000 | 10000000 | High bit alone, the start of non-ASCII |
377 | 11111111 | 11111111 | Every bit set, the largest byte |
Eights and Nines Are Refused
Those digits do not exist in base-8, so they never enter the field — a free check on any column you transcribe by hand.
Bits Shown in Fours
The output is spaced in nibbles even though the input grouped in threes, which makes the mismatch between the two bases visible on screen.
Full Words Convert Cleanly
A six-digit machine word such as 177777 expands to all sixteen bits at once, and longer values keep their precision through big-integer arithmetic.
Questions About Octal Dumps
Can I paste a whole dump line into the field?
The spaces are removed on entry, so several columns would run together into one huge value. Feed the columns separately if you want each byte's bits.
How many bits does a six-digit octal word hold?
Up to eighteen, but the classic 16-bit ceiling is 177777, which converts to sixteen ones and equals 65535. Anything larger than that would not have fitted in a minicomputer word.
Why did older machines prefer base-8 to base-16?
Their word sizes divided by three, not by four, and an octal digit needs no extra symbols beyond the ten we already have. Once eight-bit bytes became standard, four-bit digits fitted better and hex took over.
Why is the leading zero of 012 missing from the bits?
Because it adds nothing to the value. The output is the shortest pattern that represents the number, so you decide whether it is drawn as a byte, a word or a nine-bit mode.
Does an octal dump show the same order as memory?
Byte-oriented output such as od -b follows the file exactly. Word-oriented modes group two bytes at a time and follow the machine's own ordering, so the columns can look reversed against the raw bytes.
No comments yet. Be the first to comment!