HP-UX Reference (11i v1 05/09) - 1 User Commands N-Z (vol 2)

o
od(1) od(1)
order in which the type specification characters appear.
-v Write all input data. Without the
-v option, any number of groups of output
lines, that would be identical to the immediately preceding group of output lines
(except for the byte offsets), are replaced with a line containing only an asterisk
(
*).
file Pathname of one or more input files to be processed. If file is not specified, the
standard input is used.
Input files can be any file type.
DESCRIPTION OF PRE-POSIX USAGE
od and xd dump file in one or more formats as selected by the first argument. If the first argument is
missing, the default is -o for od;
-x for xd. An offset field is inserted at the beginning of each line. For
od, the offset is in octal, for
xd, the offset is in hexadecimal.
Options
od and xd recognize the following format options:
-b Interpret bytes in octal (hexadecimal).
-c Interpret bytes in ASCII. Certain non-graphic characters appear as C escapes: null=\0,
backspace=\b, form-feed=\f, new-line=\n, return=\r, tab=\t; others appear as 3-digit octal
numbers.
-d Interpret 16-bit words in decimal.
-o Interpret 16-bit words in octal.
-s Interpret 16-bit words in signed decimal.
-x Interpret 16-bit words in hexadecimal.
file specifies which file is to be dumped. If file is not specified, the standard input is used.
offset specifies the offset in the file where dumping is to commence, and is normally interpreted as octal
bytes. Interpretation can be altered as follows:
offset must be preceded by
+ if the file argument is omitted.
offset preceded by 0x is interpreted in hexadecimal.
offset followed by . is interpreted in decimal.
offset followed by b is interpreted in blocks of 512 bytes.
Dumping continues until end-of-file.
EXAMPLES
Write hexadecimal bytes and the corresponding octal values to the standard output in blocks of 16 bytes in
one line, by transforming the data from the input file file1:
od -tx1oC file1
The following commands write one line each of the types character, signed decimal integer, and float, in the
order given, transforming 100 bytes of data starting from fifteenth byte offset in the file
file1:
od -j14 -N100 -tc -tdfF file1
od -j0xe -N100 -tcd4fF file1
Write one line each of the types unsigned integer, named character, and long double, with the offsets writ-
ten in hexadecimal and forcing a write, even on lines that are identical to the immediately preceding group
of output lines:
od -v -Ax -tuafL file1
WARNINGS
When the output format is of floating-point type; i.e., when using the -t fD, -t fL,or -t f options:
If the input bytes cannot be transformed into a valid floating point number, a floating point excep-
tion might occur. In that case, the output is printed as a string containing some non-numeric char-
acters and program execution continues.
HP-UX 11i Version 1: September 2005 2 Hewlett-Packard Company Section 1669