od [-v][-A address_base][-j
skip][-N count][-t type_string]...
[file...]
od [-bcdosx][file] [[+]offset[.][b]]
The od utility shall write the contents of its input files to standard output in a user-specified format.
The od utility shall conform to the Base Definitions volume of IEEE Std 1003.1-2001, Section 12.2, Utility Syntax Guidelines, except that the order of presentation of the -t options and the -bcdosx options is significant.
The following options shall be supported:
Specify the input offset base. See the EXTENDED DESCRIPTION section. The application shall ensure that the address_base option-argument is a character. The characters ’d’ , ’o’ , and ’x’ specify that the offset base shall be written in decimal, octal, or hexadecimal, respectively. The character ’n’ specifies that the offset shall not be written.
By default, the skip option-argument shall be interpreted as a decimal number. With a leading 0x or 0X, the offset shall be interpreted as a hexadecimal number; otherwise, with a leading ’0’ , the offset shall be interpreted as an octal number. Appending the character ’b’ , ’k’ , or ’m’ to offset shall cause it to be interpreted as a multiple of 512, 1024, or 1048576 bytes, respectively. If the skip number is hexadecimal, any appended ’b’ shall be considered to be the final hexadecimal digit.
Specify one or more output types. See the EXTENDED DESCRIPTION section. The application shall ensure that the type_string option-argument is a string specifying the types to be used when writing the input data. The string shall consist of the type specification characters a , c , d , f , o , u , and x , specifying named character, character, signed decimal, floating point, octal, unsigned decimal, and hexadecimal, respectively. The type specification characters d , f , o , u , and x can be followed by an optional unsigned decimal integer that specifies the number of bytes to be transformed by each instance of the output type. The type specification character f can be followed by an optional F , D , or L indicating that the conversion should be applied to an item of type float, double, or long double, respectively. The type specification characters d , o , u , and x can be followed by an optional C , S , I , or L indicating that the conversion should be applied to an item of type char, short, int, or long, respectively. Multiple types can be concatenated within the same type_string and multiple -t options can be specified. Output lines shall be written for each type specified in the order in which the type specification characters are specified.
Multiple types can be specified by using multiple -bcdostx options. Output lines are written for each type specified in the order in which the types are specified.
The following operands shall be supported:
If there are no more than two operands, none of the -A, -j, -N, or -t options is specified, and either of the following is true: the first character of the last operand is a plus sign ( ’+’ ), or there are two operands and the first character of the last operand is numeric; the last operand shall be interpreted as an offset operand on XSI-conformant systems. Under these conditions, the results are unspecified on systems that are not XSI-conformant systems.
The standard input shall be used only if no file operands are specified. See the INPUT FILES section.
The input files can be any file type.
The following environment variables shall affect the execution of od:
Determine the locale for selecting the radix character used when writing floating-point formatted output.
Default.
See the EXTENDED DESCRIPTION section.
The standard error shall be used only for diagnostic messages.
None.
The od utility shall copy sequentially each input file to standard output, transforming the input data according to the output types specified by the -t option or the -bcdosx options. If no output type is specified, the default output shall be as if -t oS had been specified.
The number of bytes transformed by the output type specifier c may be variable depending on the LC_CTYPE category.
The default number of bytes transformed by output type specifiers d , f , o , u , and x corresponds to the various C-language types as follows. If the c99 compiler is present on the system, these specifiers shall correspond to the sizes used by default in that compiler. Otherwise, these sizes may vary among systems that conform to IEEE Std 1003.1-2001.
For the type specifier characters d , o , u , and x , the default number of bytes shall correspond to the size of the underlying implementation’s basic integer type. For these specifier characters, the implementation shall support values of the optional number of bytes to be converted corresponding to the number of bytes in the C-language types char, short, int, and long. These numbers can also be specified by an application as the characters ’C’ , ’S’ , ’I’ , and ’L’ , respectively. The implementation shall also support the values 1, 2, 4, and 8, even if it provides no C-Language types of those sizes. The implementation shall support the decimal value corresponding to the C-language type long long. The byte order used when interpreting numeric values is implementation-defined, but shall correspond to the order in which a constant of the corresponding type is stored in memory on the system.
For the type specifier character f , the default number of bytes shall correspond to the number of bytes in the underlying implementation’s basic double precision floating-point data type. The implementation shall support values of the optional number of bytes to be converted corresponding to the number of bytes in the C-language types float, double, and long double. These numbers can also be specified by an application as the characters ’F’ , ’D’ , and ’L’ , respectively.
The type specifier character a specifies
that bytes shall be interpreted as named characters from the International
Reference Version (IRV) of the ISO/IEC 646:1991 standard. Only the least
significant seven bits of each byte shall be used for this type specification.
Bytes with the values listed in the following table shall be written using
the corresponding names for those characters.
Table: Named Characters in od