DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH
 

od(C)


od -- display files in octal format

Syntax

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

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

Description

The od command displays file in one or more formats as selected by the command line arguments. If no output format is specified by any of the command line options, -o is used as a default. The meanings of the format options are:

-A address_base
Specifies the base to be used when outputting the offset of the line from the input file. The address_base must be one of the following letters, which have the following meanings:

d
offset base written in decimal

n
no offset will be written

o
offset base written in octal

x
offset base written in hexadecimal

-b
Interprets bytes in octal.

-c
Interprets bytes in ASCII. Certain nongraphic characters appear as C escapes: null=\0, backspace=\b, form feed=\f, newline=\n, return=\r, tab=\t; others appear as 3-digit octal numbers. The -c option is equivalent to -t c.

-d
Interprets words in unsigned decimal.

-h
Interprets words in hex.

-j skip
Jump over skip bytes from the start of the input. If the combined input of all available input files is less than skip an error message is written to standard error and od exits.

By default, the argument skip is considered to be a decimal number. With a leading 0x or 0X, skip is evaluated as a hexadecimal number. With a leading 0, skip is evaluated as an octal number. Any one of the following characters can be appended to the skip argument with the listed effect:


b
multiply the offset by 512

k
multiply the offset by 1024

m
multiply the offset by 1048576

Note that a terminating b in a hexadecimal argument is considered to be the last digit of the argument.


-N count
Format at most count bytes of output.

By default, the argument count is considered to be a decimal number. With a leading 0x or 0X, count is evaluated as a hexadecimal number. With a leading 0, count is evaluated as an octal number. If count bytes of input are not available after skipping any bytes specified by the -j option, od outputs the available data and exits without an error.


-o
Interprets words in octal.

-s
Interprets words in signed decimal.

-t type_string
Use type_string to specify the output format.

The type_string is composed of one or more type specifiers. Each type specifier is one of the characters in the following table, optionally followed by a modifier character:

specifier character optional modifier type specified default number of bytes
a named character 1
c character 1
d 1,C,2,S,4,I or L signed decimal 4
f 4,F,8,D or L floating point 8
o 1,C,2,S,4,I or L octal 4
u 1,C,2,S,4,I or L unsigned decimal 4
x 1,C,2,S,4,I or L hexadecimal 4

 +----------+------------------+------------------+-------------------+
 |specifier | optional         | type specified   | default number of |
 |character | modifier         |                  | bytes             |
 +----------+------------------+------------------+-------------------+
 |a         |                  | named character  | 1                 |
 +----------+------------------+------------------+-------------------+
 |c         |                  | character        | 1                 |
 +----------+------------------+------------------+-------------------+
 |d         | 1,C,2,S,4,I or L | signed decimal   | 4                 |
 +----------+------------------+------------------+-------------------+
 |f         | 4,F,8,D or L     | floating point   | 8                 |
 +----------+------------------+------------------+-------------------+
 |o         | 1,C,2,S,4,I or L | octal            | 4                 |
 +----------+------------------+------------------+-------------------+
 |u         | 1,C,2,S,4,I or L | unsigned decimal | 4                 |
 +----------+------------------+------------------+-------------------+
 |x         | 1,C,2,S,4,I or L | hexadecimal      | 4                 |
 +----------+------------------+------------------+-------------------+

The optional modifier can be used to indicate the number of bytes to be converted by the specifier. It is either a number or one of the characters C, S, I, L, F or D, which corresponds to the number of bytes in a char, short, int, long, float or double respectively.

More than one type specifier may be specified in a type_string, and there may be multiple -t options. Output lines are written for each specifier in the order in which they are supplied.


-v
All lines of output are printed. The default behavior if this option is not specified is to print an asterisk ``*'' for any group of lines that are identical to the previously printed line.

-x
Interprets words in hex.
The file argument specifies which file is to be displayed. If no file argument is specified, the standard input is used.

The offset argument specifies the offset in the file to display from. 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. If the file argument is omitted, the offset argument must be preceded by ``+''.

The display continues until end-of-file.

See also

adb(CP), hd(C)

Standards conformance

od is conformant with:

ISO/IEC DIS 9945-2:1992, Information technology - Portable Operating System Interface (POSIX) - Part 2: Shell and Utilities (IEEE Std 1003.2-1992);
AT&T SVID Issue 2;
X/Open CAE Specification, Commands and Utilities, Issue 4, 1992.


© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003