od(1) — Commands
OSF
NAME
od − Writes the contents of a file to standard output
SYNOPSIS
od [-abBcCdDefFhHiIlLopPvxX] [-snumber] [-wnumber] [file] [+] [offset]
[.][b | B] [label][.][b | B]
od -a [-p | -P] [-bBcCdDefFhHiIlLovxX] [-snumber] [-wnumber] [file]
[+] [offset][.][b | B] [label][.][b | B]
The od command reads file (standard input by default), and writes the information stored in file to standard output using the format specified by the first flag. If you do not specify the first flag, the -o flag is the default.
FLAGS
Format characters are as follows:
-aDisplays bytes as characters and displays them with their ASCII names. If the p character is also given, bytes with even parity are underlined. The P character causes bytes with odd parity to be underlined. Otherwise, parity is ignored.
-bDisplays bytes as octal values.
-BDisplays short words as octal values.
-cDisplays bytes as ASCII characters. The following nongraphic characters appear as C escape sequences:
\0Null
\bBackspace
\fFormfeed
\nNewline character
\rEnter
\tTab
\s1
\s2
\s3
\s4Extended character shifts
Other nongraphic characters appear as 3-digit octal numbers. Bytes with the parity bit set are displayed in octal.
-CDisplays any extended characters as standard printable ASCII characters using the appropriate character escape string.
-dDisplays short words as unsigned decimal values.
-DDisplays long words as unsigned decimal values.
-eDisplays long words as double-precision floating-point. (Same as -F.)
-fDisplays long words as single-precision floating-point.
-FDisplays long words as double-precision floating-point.
-hDisplays short words as unsigned hexadecimal values.
-HDisplays long words as unsigned hexadecimal values.
-iDisplays short words as signed decimal values.
-I, -l, -LDisplay long words as signed decimal values. (The three flags are identical.)
-oDisplays short words as octal values.
-ODisplays long words as unsigned decimal values.
-pIndicates even parity on -a conversion.
-PIndicates odd parity on -a conversion.
-s[number]
Looks for strings of ASCII graphic characters, terminated with a null byte. number specifies the minimum length string to be recognized. By default, the minimum length is 3 characters.
-vShows all data. By default, display lines that are identical to the previous line are not output, but are indicated with an ∗ (asterisk) in column 1.
w[number]
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 number is not specified, it defaults to 32.
-xDisplays short words as unsigned hexadecimal values. (Same as -h.)
-XDisplays long words as unsigned hexadecimal values. (Same as -H.)
An uppercase format character implies the long or double-precision form of the object.
The offset argument specifies the point in the file at which the output starts. The offset argument 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.
The label argument is interpreted as a pseudoaddress for the first byte displayed. It is 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 output continues until the end of the file.
DESCRIPTION
When od reads standard input, the offset and label parameters must be preceded by a + (plus sign).
EXAMPLES
1.To display a file in octal word format, a page at a time, enter:
od a.out | more
2.To translate a file into several formats at once, enter:
od -cx a.out >a.xcd
This writes a.out in hexadecimal format (the -x flag) into the file a.xcd, giving also the ASCII character equivalent, if any, of each byte (the -c flag).
3.To start in the middle of a file, enter:
od -bcx a.out +100.
This displays a.out in octal-byte, character, and hexadecimal formats, starting from the 100th byte. The . (dot) after the offset makes it a decimal number. Without the ., the dump starts from the 64th (100 octal) byte.
RELATED INFORMATION
OSF/1 User’s Guide.
Compatibility Note
The -i flag displays short words as signed decimal values. The -i flag used to be -s in System V.