coreutils: od invocation
1
1 3.4 ‘od’: Write files in octal or other formats
1 ===============================================
1
1 ‘od’ writes an unambiguous representation of each FILE (‘-’ means
1 standard input), or standard input if none are given. Synopses:
1
1 od [OPTION]... [FILE]...
1 od [-abcdfilosx]... [FILE] [[+]OFFSET[.][b]]
1 od [OPTION]... --traditional [FILE] [[+]OFFSET[.][b] [[+]LABEL[.][b]]]
1
1 Each line of output consists of the offset in the input, followed by
1 groups of data from the file. By default, ‘od’ prints the offset in
1 octal, and each group of file data is a C ‘short int’’s worth of input
1 printed as a single octal number.
1
1 If OFFSET is given, it specifies how many input bytes to skip before
1 formatting and writing. By default, it is interpreted as an octal
1 number, but the optional trailing decimal point causes it to be
1 interpreted as decimal. If no decimal is specified and the offset
1 begins with ‘0x’ or ‘0X’ it is interpreted as a hexadecimal number. If
1 there is a trailing ‘b’, the number of bytes skipped will be OFFSET
1 multiplied by 512.
1
1 If a command is of both the first and second forms, the second form
1 is assumed if the last operand begins with ‘+’ or (if there are two
1 operands) a digit. For example, in ‘od foo 10’ and ‘od +10’ the ‘10’ is
1 an offset, whereas in ‘od 10’ the ‘10’ is a file name.
1
11 The program accepts the following options. Also see ⇒Common
options.
1
1 ‘-A RADIX’
1 ‘--address-radix=RADIX’
1 Select the base in which file offsets are printed. RADIX can be
1 one of the following:
1
1 ‘d’
1 decimal;
1 ‘o’
1 octal;
1 ‘x’
1 hexadecimal;
1 ‘n’
1 none (do not print offsets).
1
1 The default is octal.
1
1 ‘--endian=ORDER’
1 Reorder input bytes, to handle inputs with differing byte orders,
1 or to provide consistent output independent of the endian
1 convention of the current system. Swapping is performed according
1 to the specified ‘--type’ size and endian ORDER, which can be
1 ‘little’ or ‘big’.
1
1 ‘-j BYTES’
1 ‘--skip-bytes=BYTES’
1 Skip BYTES input bytes before formatting and writing. If BYTES
1 begins with ‘0x’ or ‘0X’, it is interpreted in hexadecimal;
1 otherwise, if it begins with ‘0’, in octal; otherwise, in decimal.
1 BYTES may be, or may be an integer optionally followed by, one of
1 the following multiplicative suffixes:
1 ‘b’ => 512 ("blocks")
1 ‘KB’ => 1000 (KiloBytes)
1 ‘K’ => 1024 (KibiBytes)
1 ‘MB’ => 1000*1000 (MegaBytes)
1 ‘M’ => 1024*1024 (MebiBytes)
1 ‘GB’ => 1000*1000*1000 (GigaBytes)
1 ‘G’ => 1024*1024*1024 (GibiBytes)
1 and so on for ‘T’, ‘P’, ‘E’, ‘Z’, and ‘Y’.
1
1 ‘-N BYTES’
1 ‘--read-bytes=BYTES’
1 Output at most BYTES bytes of the input. Prefixes and suffixes on
1 ‘bytes’ are interpreted as for the ‘-j’ option.
1
1 ‘-S BYTES’
1 ‘--strings[=BYTES]’
1 Instead of the normal output, output only “string constants”: at
1 least BYTES consecutive ASCII graphic characters, followed by a
1 zero byte (ASCII NUL). Prefixes and suffixes on BYTES are
1 interpreted as for the ‘-j’ option.
1
1 If BYTES is omitted with ‘--strings’, the default is 3.
1
1 ‘-t TYPE’
1 ‘--format=TYPE’
1 Select the format in which to output the file data. TYPE is a
1 string of one or more of the below type indicator characters. If
1 you include more than one type indicator character in a single TYPE
1 string, or use this option more than once, ‘od’ writes one copy of
1 each output line using each of the data types that you specified,
1 in the order that you specified.
1
1 Adding a trailing “z” to any type specification appends a display
1 of the single byte character representation of the printable
1 characters to the output line generated by the type specification.
1
1 ‘a’
1 named character, ignoring high-order bit
1 ‘c’
1 printable single byte character, C backslash escape or a 3
1 digit octal sequence
1 ‘d’
1 signed decimal
1 ‘f’
1 floating point (⇒Floating point)
1 ‘o’
1 octal
1 ‘u’
1 unsigned decimal
1 ‘x’
1 hexadecimal
1
1 The type ‘a’ outputs things like ‘sp’ for space, ‘nl’ for newline,
1 and ‘nul’ for a zero byte. Only the least significant seven bits
1 of each byte is used; the high-order bit is ignored. Type ‘c’
1 outputs ‘ ’, ‘\n’, and ‘\0’, respectively.
1
1 Except for types ‘a’ and ‘c’, you can specify the number of bytes
1 to use in interpreting each number in the given data type by
1 following the type indicator character with a decimal integer.
1 Alternately, you can specify the size of one of the C compiler’s
1 built-in data types by following the type indicator character with
1 one of the following characters. For integers (‘d’, ‘o’, ‘u’,
1 ‘x’):
1
1 ‘C’
1 char
1 ‘S’
1 short
1 ‘I’
1 int
1 ‘L’
1 long
1
1 For floating point (‘f’):
1
1 F
1 float
1 D
1 double
1 L
1 long double
1
1 ‘-v’
1 ‘--output-duplicates’
1 Output consecutive lines that are identical. By default, when two
1 or more consecutive output lines would be identical, ‘od’ outputs
1 only the first line, and puts just an asterisk on the following
1 line to indicate the elision.
1
1 ‘-w[N]’
1 ‘--width[=N]’
1 Dump ‘n’ input bytes per output line. This must be a multiple of
1 the least common multiple of the sizes associated with the
1 specified output types.
1
1 If this option is not given at all, the default is 16. If N is
1 omitted, the default is 32.
1
1 The next several options are shorthands for format specifications.
1 GNU ‘od’ accepts any combination of shorthands and format specification
1 options. These options accumulate.
1
1 ‘-a’
1 Output as named characters. Equivalent to ‘-t a’.
1
1 ‘-b’
1 Output as octal bytes. Equivalent to ‘-t o1’.
1
1 ‘-c’
1 Output as printable single byte characters, C backslash escapes or
1 3 digit octal sequences. Equivalent to ‘-t c’.
1
1 ‘-d’
1 Output as unsigned decimal two-byte units. Equivalent to ‘-t u2’.
1
1 ‘-f’
1 Output as floats. Equivalent to ‘-t fF’.
1
1 ‘-i’
1 Output as decimal ints. Equivalent to ‘-t dI’.
1
1 ‘-l’
1 Output as decimal long ints. Equivalent to ‘-t dL’.
1
1 ‘-o’
1 Output as octal two-byte units. Equivalent to ‘-t o2’.
1
1 ‘-s’
1 Output as decimal two-byte units. Equivalent to ‘-t d2’.
1
1 ‘-x’
1 Output as hexadecimal two-byte units. Equivalent to ‘-t x2’.
1
1 ‘--traditional’
1 Recognize the non-option label argument that traditional ‘od’
1 accepted. The following syntax:
1
1 od --traditional [FILE] [[+]OFFSET[.][b] [[+]LABEL[.][b]]]
1
1 can be used to specify at most one file and optional arguments
1 specifying an offset and a pseudo-start address, LABEL. The LABEL
1 argument is interpreted just like OFFSET, but it specifies an
1 initial pseudo-address. The pseudo-addresses are displayed in
1 parentheses following any normal address.
1
1 An exit status of zero indicates success, and a nonzero value
1 indicates failure.
1