od(1)									od(1)



NAME
  od - Writes the contents of a file to standard output

SYNOPSIS

  od [-v] [-Q] [-A address_base] [-j skip] [-N count] [-t type_string...]
       [file ...]

  od [-abBcCdDefFhHiIlLoOpPSvxX] [-A address_base] [-j skip] [-N count]
       [-t type_string...] [-s[number]] [-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:

  -Q  Displays quadwords as hexadecimal values. This option applies only to
      the operating system for Alpha AXP systems.

  -a  Displays bytes as characters and displays them with their ASCII names.
      If the p character is also given, bytes with even parity are under-
      lined.  The P character causes bytes with odd parity to be underlined.
      Otherwise, parity is ignored.

  -A address_base
      Specifies the input offset base with the single-character address_base
      argument.	 The characters d, o, and x specify that the offset base be
      written in decimal, octal, or hexadecimal, respectively.	The character
      n specifies that the offset not be written at all.

  -b  Displays bytes as octal values.

  -B  Displays short words as octal values.

  -c  Displays bytes as characters using the current setting of the LC_CTYPE
      variable.	 The following nongraphic characters appear as C escape
      sequences:

      \0  Null

      \a  Alarm (or bell)

      \b  Backspace

      \f  Formfeed

      \n  Newline character

      \r  Enter

      \t  Tab

      \v  Vertical tab

      Other nongraphic characters appear as 3-digit octal numbers.  Bytes
      with the parity bit set are displayed in octal.

  -C  Displays any extended characters as standard printable ASCII characters
      using the appropriate character escape string.

  -d  Displays short words as unsigned decimal values.

  -D  Displays long words as unsigned decimal values.

  -e  Displays long words as double-precision, floating-point.	(Same as -F.)

  -f  Displays long words as single-precision, floating-point.

  -F  Displays long words as double-precision, floating-point.

  -h  Displays short words as unsigned hexadecimal values.

  -H  Displays long words as unsigned hexadecimal values.

  -i  Displays short words as signed decimal values.

  -I, -l, -L
      Display long words as signed decimal values.  (The three flags are
      identical.)

  -j skip
      Jumps over (reading or seeking) skip bytes from the beginning of the
      concatenated input files.	 If the input is not at least skip bytes
      long, od writes a diagnostic message to standard error and returns a
      nonzero exit value.

      The skip argument is interpreted as a decimal number by default.	If
      you include a leading offset of 0x or 0X, skip is interpreted as a hex-
      adecimal number.	A leading offset of 0 (zero) causes skip to be inter-
      preted as an octal number.

      If you append the character b, k, or m to skip, the number is inter-
      preted as a multiple of 512, 1024, or 1,048,576 bytes, respectively.

  -N count
      Causes od to format no more than count bytes of input.

      The count argument is interpreted as a decimal number by default.	 If
      you include a leading offset of 0x or 0X, count is interpreted as a
      hexadecimal number.  A leading offset of 0 (zero) causes count to be
      interpreted as an octal number.  If there are not count bytes of input
      available (after successfully skipping bytes as specified by -j), od
      formats the available input.

  -o  Displays short words as octal values.

  -O  Displays long words as unsigned octal values.

  -p  Indicates even parity on -a conversion.

  -P  Indicates odd parity on -a conversion.

  -s[number]
      Looks for strings of ASCII graphic characters, terminated with a null
      byte. The number argument specifies the minimum length string to be
      recognized. By default, the minimum length is 3 characters.  Allowable
      characters are those between blank (040) and tilde (0176), as well as
      backspace, tab, linefeed, formfeed, and carriage-return (010 through
      015, except 013).

  -s  If the environment variable CMD_ENV is set to svr4, displays signed
      words (32-bit or DEC OSF/1 short words) as signed decimal values.

  -S  Displays long words as signed decimal values.

  -t type_string...
      Specifies one or more output types.  The type_string argument is a
      string that specifies the types to be used when writing the input data.
      type_string consists of the following type specification characters:

      a	  Named character

      c	  Character

      d	  Signed decimal

      f	  Floating point

      o	  Octal

      u	  Unsigned decimal

      x	  Hexadecimal

      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 one of the fol-
      lowing optional characters, which indicate the type of the item to
      which the conversion should be applied.

      F	  float

      D	  double

      L	  long double

      The type specification characters d, o, u, and x can be followed by one
      of the following optional characters, which indicate the type of the
      item to which the conversion should be applied:

      C	  char

      I	  int

      L	  long

      S	  short

      You can concatenate multiple types within the same type_string argument
      and you can specify multiple -t arguments. The od command writes the
      output lines for each type specified in the order in which you entered
      the type specification characters.

  -v  Shows all data.  By default, display lines that are identical to the
      previous line are not output (except for the byte offsets), 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.

  -x  Displays short words as unsigned hexadecimal values.  (Same as -h.)

  -X  Displays 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 pre-
  ceded by a + (plus sign).

  If you omit the file argument and do not specify -A, -j, -N, or -t, you
  must precede the offset argument by a + (plus sign) character.

  If the first character of file is a + (plus sign) or the first character of
  the first file argument is numeric, you give no more than two arguments,
  and specify none of the -A, -j, -N, or -t flags, od assumes the argument to
  be an offset.

  If you omit the file argument and specify none of the -A, -j, -N, or -t
  flags, you must precede the offset argument by a + (plus sign) character.

  To be sure that od assumes the argument to be an offset:

    +  Make the first character of file a + sign, or the first character of
       the first file argument numeric.

    +  Give no more than two arguments.

    +  Specify none of the -A, -j, -N, or -t flags.

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 . (dot), the dump starts from the 64th
       (100 octal) byte.

  Compatibility Note

  The -i flag displays short words as signed decimal values.  The -i flag
  used to be -s in System V.

RELATED INFORMATION

  Files:  locale(4).