Name

od

Synopsis

    od [options] [file] [[+] offset[. | b]]

Octal dump; produce a dump (normally octal) of the named file. file is displayed from its beginning, unless you specify an offset (normally in octal bytes). In the following options, a “word” is a 16-bit unit.

Common Options

-Abase, --address-radix=base

Indicate how the offset should be written. Values for base are d for decimal, o for octal, x for hexadecimal, or n for no offset.

-b

Display bytes as octal.

-c

Display bytes as ASCII.

-d

Display words as unsigned decimal.

-f

Display 32-bit words as floating point.

-jskip, --skip-bytes=skip

Jump over skip bytes from the beginning of the input. skip can have a leading 0 or 0x for it to be treated as an octal or hexadecimal value. It can have a trailing b, k, or m to be treated as a multiple of 512, 1024, or 1,048,576 bytes.

-Ncount, --read-bytes=count

Process up to count input bytes.

-o

Display words as unsigned octal (the default).

-ttype_string, --format=type_string

Specify one or more output types. See the "Common Type Strings" section later in this entry.

-v, --output-duplicates

Verbose; show all data. Without this, duplicate lines print as *.

-x

Display words as hexadecimal.[*]

+

Required before offset if file isn’t specified.

Solaris and Mac OS X Options

-D

Display 32-bit words as unsigned decimal.

-F

Display 64-bit words as extended precision.

-O

Display 32-bit words as unsigned octal.

-s

Display words as signed decimal.

-X

Display 32-bit words as hexadecimal.

GNU/Linux and Mac OS X ...

Get Unix in a Nutshell, 4th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.