od
PURPOSE
Writes the contents of storage to the standard output.
SYNOPSIS
od [ -bcCdosx ] [ file ] [ [ + ] offset [ . ] [ b ] ]
DESCRIPTION
The od command reads file (standard input by default),
and it writes to standard output the information stored
in file using the format specified by the first flag. If
you do not specify the first flag, -o is the default.
When od reads standard input, num must be preceded by a +
(plus sign).
FLAGS
-b Displays bytes as 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.
-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.
-o Displays 16-bit words as octal values.
-s Displays 16-bit words as signed decimal values.
-x Displays 16-bit words as hexadecimal values.
The num parameter specifies the point in the file where
the storage output starts. The num parameter is inter-
preted as octal bytes. If a . (dot) is added to num, it
is interpreted in decimal. If b is added to num, it is
interpreted in blocks of 512 bytes.
The storage output continues until the end of the file.
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
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
The following commands: "sdb" and "pg."
The "Overview of International Character Support" in Man-
aging the AIX Operating System.