UNIX in a Nutshell: System V Edition

UNIX in a Nutshell: System V EditionSearch this book
Previous: Reference: nroffChapter 2
Unix Commands
Next: Reference: page
 

od

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.

Options

-A 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. Solaris only.

-b

Display bytes as octal.

-c

Display bytes as ASCII.

-C

Interpret bytes as characters based on the setting of LC_CTYPE. Solaris only.

-d

Display words as unsigned decimal.

-D

Display 32-bit words as unsigned decimal.

-f

Display 32-bit words as floating point.

-F

Display 64-bit words as extended precision.

-j 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. Solaris only.

-N count

Process up to count input bytes. Solaris only.

-o

Display words as unsigned octal (the default).

-O

Display 32-bit words as unsigned octal.

-s

Display words as signed decimal.

-S

Display 32-bit words as signed decimal.

-t type_string

Specify one or more output types. See the section "Type Strings." Solaris only.

-v

Verbose; show all data. Duplicate lines print as *.

-x

Display words as hexadecimal.

-X

Display 32-bit words as hexadecimal.

+

Required before offset if file isn't specified.

Modifiers for offset

.

offset value is decimal.

b

offset value is 512-byte blocks.

Type Strings

Type strings can be followed by a decimal number indicating how many bytes to process.

a

ASCII named characters (e.g., BEL for \007)

c

Single- or multibyte characters

d, o, u, x

Signed decimal, unsigned octal, decimal, and hexadecimal

f

Floating point


Previous: Reference: nroffUNIX in a Nutshell: System V EditionNext: Reference: page
Reference: nroffBook IndexReference: page

The UNIX CD Bookshelf NavigationThe UNIX CD BookshelfUNIX Power ToolsUNIX in a NutshellLearning the vi Editorsed & awkLearning the Korn ShellLearning the UNIX Operating System