OD(1) User Commands OD(1)

od - octal dump

od [-bcCdDfFoOsSvxX] [file] [[+]offset[.][b]]

od [-v] [-A address_base] [-j skip] [-N count] [-t type_string] ... [file ...]

Od dumps file in one or more formats as selected by the option arguments. If no format specification is present, -o is default. The meanings of the option arguments are:

Interpret bytes in octal.
Interpret characters. Certain non-graphic characters appear as C escapes: null=\0, backspace=\b, formfeed=\f, newline=\n, return=\r, tab=\t; others appear as 3-digit octal numbers. For a multibyte character, the graphical representation is printed for its first byte, remaining bytes are marked **.
Interpret unsigned two-byte words in decimal.
Interpret unsigned four-byte words in decimal.
Interpret floating point format as single precision.
Interpret floating point format as double precision.
Interpret two-byte words in octal.
Interpret four-byte words in octal.
Interpret signed two-byte words in decimal.
Interpret signed four-byte words in decimal.
Print identical groups of output lines that immediately follow each other instead of abbreviating all but the first one by printing a single * character.
Interpret two-byte words in hexadecimal.
Interpret four-byte words in hexadecimal.

The following option is supported as an extension:

Prints the input data interpreted as characters as another column right next to the regular output. Non-printable characters are replaced by periods.

The file argument specifies which file is to be dumped. If no file argument is specified, the standard input is used. If more than one file argument is specified, the concatenation of all files without an intervening separator is dumped.

The offset argument specifies the offset in the file where dumping is to commence. This argument is normally interpreted as octal bytes. If `.' is appended, the offset is interpreted in decimal. If `b' is appended, the offset is interpreted in blocks of 512 bytes. If the file argument is omitted, the offset argument must be preceded by `+' with /usr/5bin/posix/od.

The following options have been introduced by POSIX.2. If any of these options is present, an offset-like argument is always interpreted as the name of a file to be dumped.

Sets the format of the file offset printed in the first column. Valid values for address_base are:
Print offset as decimal.
Print no offset column.
Print offset as octal (default).
Print offset as hexadecimal.
Skip skip bytes of input, where skip may be either a decimal number, an octal number preceded by 0, or a hexadecimal number preceded by 0x or 0X. If the last character of skip is b (if not a hexadecimal number), k, or m, the value is multiplied by 512, 1024, or 1048576, respectively.
Terminate processing after count bytes of input, where count may be either a decimal number, an octal number preceded by 0, or a hexadecimal number preceded by 0x or 0X.
Set output format. type_string may consist of one or more specifications as follows:
Print characters, ignoring the most significant bit. ASCII control characters are printed as their names, other nonprintable characters are printed as octal bytes.
c
Print characters. Non-printable characters are either printed as escape sequences `\0', `\a', `\b', `\f', `\n', `\r', `\t', `\v' or as octal bytes. For a multibyte character, the graphical representation is printed for its first byte, remaining bytes are marked **.
d[1|2|4|8|C|S|I|L]
Print signed decimal words, with the word length indicated by the second character (1 one byte per word, 2 two bytes per word, 4 four bytes per word, 8 eight bytes per word, C the size of the C language `char' data type, S the size of the C language `short' data type, I the size of the C language `int' data type, and L the size of the C language `long' data type). The default is the machine word length.
f[4|8|F|D|L]
Print floating point format, with the precision indicated by the second character (4 and F single precision, 8, D, and L double precision). The default is double precision.
o[1|2|4|8|C|S|I|L]
Print octal words, with the word length indicated by the second character as described for d above.
Print unsigned decimal words, with the word length indicated by the second character as described for d above.
x[1|2|4|8|C|S|I|L]
Print hexadecimal words, with the word length indicated by the second character as described for d above.

Unless the -N option is given, dumping continues until end-of-file.

See locale(7).
Determines the mapping of bytes to characters for the -c and -tc options.
2/6/05 Heirloom Toolchest