od - Windows command-line utility to dump specified files in specified formats


od [-v] [-A addressbase] [-j skip] [-N count] [-t typestring...] [-] | [file...]

od [-bcdosx] [-] | [file] [[+]offset[.][b]]


The od(1w) utility writes the contents of its input files to the standard output in a user-specified format.

The od utility copies sequentially each input file to the standard output, transforming the input data according to the output types specified by the -t or the -bcdosx options. If no output type is specified, the default output is as if -t o2 has been specified.

The type-specifier character specifies that bytes be interpreted as named characters from the International Reference Version (IRV) of the International Organization for Standardization/International Electrotechnical Commission (ISO/IEC) 646:1991 standard. Only the least significant seven bits of each byte are used for this type specification. Bytes with the values listed in the following table are written using the corresponding names for those characters.

Value Name Value Name Value Name Value Name
/000 Nul /001 soh /002 stx /003 etx
/004 Eot /005 enq /006 ack /007 bel
/010 Bs /011 ht /012 lf or nl /013 vt
/014 ff /015 cr /016 so /017 si
/020 Dle /021 dc1 /022 dc2 /023 dc3
/024 Dc4 /025 nak /026 syn /027 etb
/030 Can /031 em /032 sub /033 esc
/034 Fs /035 gs /036 rs /037 us
/040 Sp /177 del

The /012 value can be written either as lf or nl.

The type-specifier character c specifies that bytes be interpreted as characters. Printable multibyte characters are written in the area corresponding to the first byte of the character. Two asterisks (**) are written in the area corresponding to each remaining byte in the character, as an indication that the character is continued. When either the -j skip or -N count option is specified along with the c type specifier, and this results in an attempt to start or finish in the middle of a multibyte character, the result is unspecified.

The input data is manipulated in blocks, where a block is defined as a multiple of the least common multiple of the number of bytes, transformed by the specified output types. If the least common multiple is greater than 16, the results are unspecified. Each input block is written as transformed by each output type, one per written line, in the order that the output types were specified. If the input block size is larger than the number of bytes transformed by the output type, the output type sequentially transforms the parts of the input block. The output from each of the transformations is separated by one or more blank characters.

If, as a result of the specification of the -N option or end-of-file being reached on the last input file, input data only partially satisfies an output type, the input is extended sufficiently with null bytes to write the last byte of the input.

Unless -A n is specified, the first output line produced for each input block is preceded by the input offset, and is cumulative across input files of the next byte to be written. The format of the input offset is unspecified. It will not contain any blank characters, however. It starts at the first character of the output line, and is followed by one or more blank characters. In addition, the offset of the byte following the last byte written will be written after all the input data has been processed, but will not be followed by any blank characters.

If the -A option is not specified, the input offset base is unspecified.


The od utility supports the following options:

-A addressbase
Specifies the input offset base. The addressbase option-argument is a character. The options d, o, and x specify that the offset base be written in decimal, octal, or hexadecimal, respectively. The n option specifies that the offset not be written.
Interprets bytes in octal. This is equivalent to t-o1.
Interprets bytes as characters specified by the current setting of the LC_CTYPE category. Certain nongraphic characters appear as C escapes: NUL=\0, BS=\b, FF=\f, NL=\n, CR=\r, HT=\t. Others appear as three-digit octal numbers.
Interprets words (two-byte units) in unsigned decimal format. This is equivalent to t-u2.
-j skip
Jumps over skip bytes from the beginning of the input. The od utility reads or seeks past the first skip bytes in the concatenated input files. If the combined input is not at least skip bytes long, od writes a diagnostic message to the standard error and exits with a nonzero exit status.

By default, the skip option-argument is interpreted as a decimal number. With a leading 0x or 0X, offset is interpreted as a hexadecimal number. Otherwise, with a leading 0, offset is interpreted as an octal number. Appending the option b, k, or m to offset causes it to be interpreted as a multiple of 512, 1,024 or 1,048,576 bytes, respectively. If the skip number is hexadecimal, any appended b is considered to be the final hexadecimal digit.

-N count
Formats no more than count bytes of input. By default, count is interpreted as a decimal number. With a leading 0x or 0X, count is interpreted as a hexadecimal number. Otherwise, with a leading 0, count is interpreted as an octal number. If count bytes of input (after successfully skipping, if -j skip is specified) are not available, it is not considered an error. The od utility formats the input that is available.
Interprets words (2-byte units) in signed decimal format. This is equivalent to t-d2.
-t typestring
Specifies one or more output types. The typestring option-argument must be a string specifying the types to be used when writing the input data. The string must consist of the type specification characters a (named character), c (character), d (signed decimal), f (floating point), o (octal), u (unsigned decimal), or x (hexadecimal).
Writes all input data. Without the -v option, any number of groups of output lines that are identical to the immediately preceding group of output lines (except for the byte offsets), are replaced with a line containing only an asterisk (*).
Interprets words (two-byte units) in hexadecimal format. This is equivalent to t-x2.

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 od utility supports the following arguments:

The path of the file to be written. If no file operands are specified, the standard input is used. The operand is assumed to be a file if the first character of file is a plus sign (+), or the first character of the first file operand is numeric, no more than two operands are given, and none of the -A, -j, -N, or -t options are specified.
The offset argument specifies the offset in the file where dumping commences. This operand is normally interpreted as octal bytes. If a period or dot (.) is appended, the offset is interpreted in decimal format. If b is appended, the offset is interpreted in 512-byte units. If the file argument is omitted, and none of the -A, -j, -N, or -t options are specified, the offset argument must be preceded by a plus sign (+).


Possible exit-status values are:

Successful completion


If a file containing 128 bytes, with decimal values 0 to 127 in increasing order, is supplied as standard input to the command:

od -A d -t a

on an implementation using an input block size of 16 bytes, the standard output, independent of the current locale setting, will be similar to:

0000000 nul soh stx etx eot enq ack bel bs ht nl vt ff cr so si 0000016 dle dc1 dc2 dc3 dc4 nak syn etb can em sub esc fs gs rs us 0000032 sp ! " # $ % & ' ( ) * + , - . / 0000048 0 1 2 3 4 5 6 7 8 9 : ; < = > ? 0000064 @ A B C D E F G H I J K L M N O 0000080 P Q R S T U V W X Y Z [ \ ] ^ _ 0000096 ` a b c d e f g h i j k l m n o 0000112 p q r s t u v w x y z { | } ~ del 0000128