unixdev.net


Switch to SpeakEasy.net DSL

The Modular Manual Browser

Home Page
Manual: (OSF1-V5.1-alpha)
Page:
Section:
Apropos / Subsearch:
optional field



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] [-s[number]] [-w[number]] [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 option.  If	you do not specify the first option, the -o option is
  the default.

STANDARDS

  Interfaces documented	on this	reference page conform to industry standards
  as follows:

  od:  XCU5.0

  Refer	to the standards(5) reference page for more information	about indus-
  try standards	and associated tags.

OPTIONS

  Format characters are	as follows:

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

  -a  [Tru64 UNIX]  Displays bytes as characters and displays them with	their
      ASCII names.  If the p character is also given, bytes with even parity
      are underlined.  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  [Tru64 UNIX]  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  [Tru64 UNIX]	Alarm (or bell)

      \b  Backspace

      \f  Formfeed

      \n  Newline character

      \r  Enter

      \t  Tab

      \v  [Tru64 UNIX]	Vertical tab

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

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

  -d  Displays short words as unsigned decimal values.

  -D  [Tru64 UNIX]  Displays long words	as unsigned decimal values.

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

  -f  [Tru64 UNIX]  Displays long words	as single-precision, floating-point.

  -F  [Tru64 UNIX]  Displays long words	as double-precision, floating-point.

  -h  [Tru64 UNIX]  Displays short words as unsigned hexadecimal values.

  -H  [Tru64 UNIX]  Displays long words	as unsigned hexadecimal	values.

  -i  [Tru64 UNIX]  Displays short words as signed decimal values.

  -I, -l, -L
      [Tru64 UNIX]  Display long words as signed decimal values.  (The three
      options 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.
      If b is appended to a skip interpreted as	hexadecimal, it	is recognized
      as the last digit	of the skip, not a block indicator.

  -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  [Tru64 UNIX]  Displays long words	as unsigned octal values.

  -p  [Tru64 UNIX]  Indicates even parity on -a	conversion.

  -P  [Tru64 UNIX]  Indicates odd parity on -a conversion.

  -s[number]
      [Tru64 UNIX]  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 charac-
      ters.  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 Tru64 UNIX short	words) as signed decimal values.

      [Tru64 UNIX]  If the environment variable	CMD_ENV	is set to xpg4,
      action is	the same as using the -i option.

  -S  [Tru64 UNIX]  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.
      The type_string argument 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]
      [Tru64 UNIX]  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  [Tru64 UNIX]  Displays long words	as unsigned hexadecimal	values.
      (Same as -H.)

  [Tru64 UNIX]	An uppercase format character implies the long or double-
  precision form of the	object.

OPERANDS

  file
      A	path name of a file to be written.  If no file operands	are speci-
      fied, the	standard input will be used.  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	is specified, the operand is assumed to	be an offset.

  offset
      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 to a nonhexade-
      cimal offset, the	offset is interpreted as a block count,	where a	block
      is 512 (1024) bytes.  If b (B) is	appended to a hexadecimal offset, the
      b	(B) is interpreted as part of the offset and the offset	is not inter-
      preted as	a block	count; a block count can be specified only with	a
      decimal or an octal offset.

  label
      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.

DESCRIPTION

  The output continues until the end of	the file.

  When od reads	standard input,	the offset and label operands 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.

  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 options.

RESTRICTIONS

  The od command has the following restrictions:

    +  You cannot use the command with disks that have a capacity of more
       than 4 GB.

    +  You cannot specify an offset of more than (2**32)-1 as a	starting
       point.

NOTES

  [Tru64 UNIX]	The -i option displays short words as signed decimal values.
  The -i option	used to	be -s in System	V.

EXIT STATUS

  The following	exit values are	returned:

  0   All input	files were processed successfully.

  >>0  An error occurred.

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 option) into the	file
       a.xcd, giving also the ASCII character equivalent, if any, of each
       byte (the -c option).

   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.

ENVIRONMENT VARIABLES

  The following	environment variables affect the execution of od:

  LANG
      Provides a default value for the internationalization variables that
      are unset	or null.  If LANG is unset or null, the	corresponding value
      from the default locale is used.	If any of the internationalization
      variables	contain	an invalid setting, the	utility	behaves	as if none of
      the variables had	been defined.

  LC_ALL
      If set to	a non-empty string value, overrides the	values of all the
      other internationalization variables.

  LC_CTYPE
      Determines the locale for	the interpretation of sequences	of bytes of
      text data	as characters (for example, single-byte	as opposed to multi-
      byte characters in arguments).

  LC_MESSAGES
      Determines the locale for	the format and contents	of diagnostic mes-
      sages written to standard	error.

  NLSPATH
      Determines the location of message catalogues for	the processing of
      LC_MESSAGES.

SEE ALSO

  Commands:  sed(1)

  Files:  locale(4)

  Standards:  standards(5)