OD(1,C) AIX Commands Reference OD(1,C)
-------------------------------------------------------------------------------
od
PURPOSE
Writes the contents of storage to standard output.
SYNTAX
+------- -o -------+
| one of |
| +--------+ | +--------------+ +---------------+ +------+
od ---| +--| -a -c |--+ |--| +- 3 -+ |--| +- 32 -+ |--| |--->
| | | -b -C | | | +- -s -| |-+ +- -w -| |-+ +- -v -+
| | +--------+ | | +- n -+ +- n --+
+-| one of |-+
| +----------+ |
| | -d -F -L | |
| | -D -H -o | |
+-| -i |-+
| -f -I -x |
| -P -p -l |
+----------+
+--------+ +-------------- +0 --------------+
>---| |---| +-----+1+- num ---+ +--------+ |---|
+- file -+ +-| |-+- num. --+-| one of |-+
+- + -+ |- 0xnum -| | 1+---+ |
+- xnum --+ +--| b |-+
| B |
+---+
-----------------
1 Do not put a blank before these items.
DESCRIPTION
The od command reads the specified file (standard input by default) and writes
to standard output the information stored in the file using the format
specified by the first flag. If you do not specify the first flag, -o is the
default. When the od command reads standard input, the num argument must be
preceded by + (plus sign).
FLAGS
Format characters are:
Processed November 8, 1990 OD(1,C) 1
OD(1,C) AIX Commands Reference OD(1,C)
-a Interprets bytes as characters and displays them with their ASCII names. If
the -P flag is given also, bytes with even parity are underlined. The -p
flag causes bytes with odd parity to be underlined. Otherwise, parity is
ignored. The -p and -P flags only work with the -a flag.
-b Displays bytes as unsigned octal values.
-c Displays bytes as ASCII characters. The following nongraphic characters
appear as C escapes sequences:
\0 Null
\b Backspace
\f Form feed
\n New-line character
\r Return
\t Tab
\s1
\s2
\s3
\s4 Extended character shifts.
Others appear as 3-digit octal numbers. Bytes with the parity bit set are
displayed in octal.
-C Displays any extended characters as standard printable ASCII characters
using the appropriate character escape string.
-d Displays 16-bit words as unsigned decimal values.
-f Interprets long words as floating point.
-h Interprets (short) words as unsigned hexadecimal.
-i Interprets (short) words as signed decimal.
-l Interprets long words as signed decimal.
-o Displays 16-bit words as octal values.
-p Causes bytes with odd parity to be underlined and modifies the behavior of
the -a flag.
-P Causes bytes with even parity to be underlined and modifies the behavior of
the -a flag.
-s[n]
Looks for strings of ASCII graphic characters, terminated with a null byte.
The n argument specifies the minimum length string to be recognized. By
default, the minimum length is 3 characters.
Processed November 8, 1990 OD(1,C) 2
OD(1,C) AIX Commands Reference OD(1,C)
-v Shows all data. By default, display lines that are identical to the last
line shown are not output but are indicated with an * (asterisk) in column
1.
-w[n]
Specifies the number of input bytes to be interpreted and displayed on each
output line. If -w is not specified, 16 bytes are read for each display
line. If the n argument is not specified, it defaults to 32.
-x Displays 16-bit words as hexadecimal values.
An uppercase format character implies the long or double precision form of the
object. Short implies 16-bit words; long implies 32-bit words.
The offset parameter specifies the point in the file where the storage output
starts. The offset parameter is interpreted as octal bytes. If a . (dot) is
added to offset, it is interpreted in decimal. If offset begins with x or 0x,
it is interpreted in hexadecimal. If b (B) is appended, the offset is
interpreted as a block count, where a block is 512 (1024) bytes.
Label will be interpreted as a pseudo-address for the first byte displayed. It
will be shown in parentheses "()" following the file offset. It is intended to
be used with core images to indicate the real memory address. The syntax for
label is identical to that for offset.
The storage output continues until the end of the file.
Notes:
1. When you are viewing a file with one of the options which specifies a 16-
or 32-bit word, the output appears differently depending on whether the
command is run on an AIX/370 or AIX PS/2 machine because the two machines
represent binary data in different ways.
2. Looking at directories with the od command invokes the UNIX System V
directory compatibility code which truncates entries to 14 characters. To
see the actual directory contents, use the fsdb command. For a description
of directory compatibility, see ulimit in the AIX Operating System
Technical Reference.
EXAMPLES
1. To display a file in octal a page at a time:
od a.out | pg
This displays a.out in octal (base 8) word format a page at a time.
2. To translate a file into several formats at once:
od -cx a.out >a.xcd
Processed November 8, 1990 OD(1,C) 3
OD(1,C) AIX Commands Reference OD(1,C)
This writes a.out in hexadecimal (base 16) format ("-x") into the file
"a.xcd", giving also the ASCII character equivalent, if any, of each byte
("-c").
3. To start in the middle of a file:
od -bcx a.out +100.
This displays a.out in octal-byte, character, and hexadecimal formats,
starting from the "100"th byte. The . (dot) after the offset makes it a
decimal number. Without the dot, the dump would start from the 64th (100
octal) byte.
RELATED INFORMATION
See the following command: "pg."
See "Introduction to International Character Support" in Managing the AIX
Operating System.
Processed November 8, 1990 OD(1,C) 4