222 lines
5.9 KiB
HTML
222 lines
5.9 KiB
HTML
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
|
||
|
<html>
|
||
|
<head>
|
||
|
<meta name="generator" content="HTML Tidy, see www.w3.org">
|
||
|
<meta http-equiv="Content-Type" content=
|
||
|
"text/html; charset=utf-8">
|
||
|
<title>od - Dump files in various formats</title>
|
||
|
<LINK rel="stylesheet" type="text/css" href="../rzahg/ic.css">
|
||
|
</HEAD>
|
||
|
<body bgcolor="#FFFFFF">
|
||
|
<!-- Java sync-link -->
|
||
|
<SCRIPT LANGUAGE="Javascript" SRC="../rzahg/synch.js" TYPE="text/javascript"></SCRIPT>
|
||
|
|
||
|
|
||
|
|
||
|
<h2>od - Dump files in various formats</h2>
|
||
|
|
||
|
<strong>Synopsis</strong>
|
||
|
|
||
|
<p>
|
||
|
<strong>od [-A</strong> <em>address_base</em><strong>]
|
||
|
[-j</strong> <em>skip</em><strong>] [-N</strong> <em>
|
||
|
count</em><strong>] [-t</strong> <em>type_string</em><strong>]
|
||
|
[-Cbcdosvx]</strong> [<em>file...</em>]
|
||
|
</p>
|
||
|
|
||
|
<p><strong>Description</strong></p>
|
||
|
|
||
|
<p>The <strong>od</strong> utility writes the contents of the
|
||
|
specified <em>files</em> to standard output in a user-specified
|
||
|
format. If the <em>file</em> parameter is not given, the <strong>
|
||
|
od</strong> command reads standard input. The format is specified
|
||
|
by the <strong>-t</strong> flag. If no format type is specified,
|
||
|
<strong>-t oS</strong> is the default.</p>
|
||
|
|
||
|
<p><strong>Options</strong></p>
|
||
|
|
||
|
<dl>
|
||
|
<dt><strong>-A</strong> <em>address_base</em></dt>
|
||
|
|
||
|
<dd>Specifies the format for the output offset base. The <em>
|
||
|
address_base</em> can be one of these values:
|
||
|
|
||
|
<ul>
|
||
|
<li><strong>d</strong> for decimal,</li>
|
||
|
|
||
|
<li><strong>o</strong> for octal,</li>
|
||
|
|
||
|
<li><strong>x</strong> for hexadecimal, or</li>
|
||
|
|
||
|
<li><strong>n</strong> for none.</li>
|
||
|
</ul>
|
||
|
|
||
|
<p>In the case of <strong>n</strong>, the offset base is not
|
||
|
displayed. If <strong>-A</strong> is not specified, <strong>-A
|
||
|
o</strong> is the default.</p>
|
||
|
</dd>
|
||
|
|
||
|
<dt><strong>-b</strong></dt>
|
||
|
|
||
|
<dd>Output bytes in octal. It is equivalent to <strong>-t 01</strong>.
|
||
|
</dd>
|
||
|
|
||
|
<dt><strong>-C</strong></dt>
|
||
|
|
||
|
<dd>Display the CCSID of the file to standard output before the
|
||
|
rest of the output is written.</dd>
|
||
|
|
||
|
<dt><strong>-c</strong></dt>
|
||
|
|
||
|
<dd>Output bytes as characters. It is equivalent to <strong>-t c</strong>.
|
||
|
</dd>
|
||
|
|
||
|
<dt><strong>-d</strong></dt>
|
||
|
|
||
|
<dd>Output bytes in unsigned decimal. It is equivalent to <strong>-t u2</strong>.
|
||
|
</dd>
|
||
|
|
||
|
<dt><strong>-j</strong> <em>skip</em></dt>
|
||
|
|
||
|
<dd>Specifies the number of bytes to skip before beginning to
|
||
|
display output. If more than one file is specified, the number of
|
||
|
bytes will be used on the concatenated input of all files
|
||
|
specified. An error will occur if this number is larger than the
|
||
|
size of the concatenated inputs. This value can be specified in
|
||
|
hexadecimal (preceded by 0x or 0X), octal (preceded by 0), or
|
||
|
decimal (default).</dd>
|
||
|
|
||
|
<dt><strong>-N</strong> <em>count</em></dt>
|
||
|
|
||
|
<dd>Specifies the number of bytes to be written. By default, the
|
||
|
whole file will be written. This value can be specified in
|
||
|
hexadecimal (preceded by 0x or 0X), octal (preceded by 0), or
|
||
|
decimal (default).</dd>
|
||
|
|
||
|
<dt><strong>-o</strong></dt>
|
||
|
|
||
|
<dd>Output bytes in octal. It is equivalent to <strong>-t o2</strong>.
|
||
|
</dd>
|
||
|
|
||
|
<dt><strong>-s</strong></dt>
|
||
|
|
||
|
<dd>Output bytes in signed decimal. It is equivalent to <strong>-t d2</strong>.
|
||
|
</dd>
|
||
|
|
||
|
<dt><strong>-t</strong> <em>type_string</em></dt>
|
||
|
|
||
|
<dd>Specifies one or more output types. The type specified must be
|
||
|
a string containing all of the formatting types that you want. The <em>
|
||
|
type_string</em> can contain these values:
|
||
|
|
||
|
<ul>
|
||
|
<li><strong>a</strong> for character,</li>
|
||
|
|
||
|
<li><strong>c</strong> for character,</li>
|
||
|
|
||
|
<li><strong>d</strong> for signed decimal,</li>
|
||
|
|
||
|
<li><strong>f</strong> for floating point,</li>
|
||
|
|
||
|
<li><strong>o</strong> for octal,</li>
|
||
|
|
||
|
<li><strong>u</strong> for unsigned decimal, or</li>
|
||
|
|
||
|
<li><strong>x</strong> for hexadecimal.</li>
|
||
|
</ul>
|
||
|
|
||
|
<p>The type specifications of <strong>a</strong> and <strong>
|
||
|
c</strong> may give unexpected results since they depend on the
|
||
|
CCSID on the data. The <strong>a</strong> type specifier displays
|
||
|
non-printable characters as named characters. The <strong>c</strong>
|
||
|
type specifier displays non-printable characters as three digit
|
||
|
octal numbers.</p>
|
||
|
|
||
|
<p>The type specifications of <strong>d, o, u</strong> and <strong>
|
||
|
x</strong> can also be followed by <strong>1, 2, 4, C, S,
|
||
|
I</strong> or <strong>L</strong>. These specify the number of bytes
|
||
|
to be transformed by each instance of the output type. The values
|
||
|
<strong>C, S, I</strong> and <strong>L</strong> correspond to char,
|
||
|
short, int and long.</p>
|
||
|
|
||
|
<p>The type specification of <strong>f</strong> can be followed by
|
||
|
by <strong>4, 8, F, D</strong> or <strong>L</strong>. These specify
|
||
|
the number of bytes to be transformed by each instance of the
|
||
|
output type. The values <strong>F, D</strong> and <strong>
|
||
|
L</strong> correspond to float, double, and long double. If <strong>-t</strong> is not specified, the default
|
||
|
is <strong>-t oS</strong>.</p>
|
||
|
</dd>
|
||
|
|
||
|
<dt><strong>-v</strong></dt>
|
||
|
|
||
|
<dd>Write all input data. Without this option, repeated output
|
||
|
lines will not be written. When repeats occur, only an asterisk (*)
|
||
|
will be written.</dd>
|
||
|
|
||
|
<dt><strong>-x</strong></dt>
|
||
|
|
||
|
<dd>Output bytes in hexadecimal. It is equivalent to <strong>-t x2</strong>.
|
||
|
</dd>
|
||
|
|
||
|
</dl>
|
||
|
|
||
|
<p><strong>Operands</strong></p>
|
||
|
|
||
|
<p>Each <em>file</em> is a path name of an object to be written to
|
||
|
standard output. If no <em>file</em> operands are specified,
|
||
|
standard input will be used.</p>
|
||
|
|
||
|
<p><strong>Exit Status</strong></p>
|
||
|
|
||
|
<ul>
|
||
|
<li>0 when successful</li>
|
||
|
|
||
|
<li>>0 when an error occurred.</li>
|
||
|
</ul>
|
||
|
|
||
|
<p><strong>Related information</strong></p>
|
||
|
|
||
|
<ul>
|
||
|
<li><a href="cat.htm">cat - Concatenate and print files</a></li>
|
||
|
|
||
|
<li><a href="pr.htm">pr - Print files</a></li>
|
||
|
</ul>
|
||
|
|
||
|
<p><strong>Examples</strong></p>
|
||
|
|
||
|
<ol>
|
||
|
<li>Dump a file in hexadecimal format.
|
||
|
|
||
|
<pre>
|
||
|
od -tx output.txt
|
||
|
</pre>
|
||
|
</li>
|
||
|
|
||
|
<li>Dump the first 50 bytes of a file.
|
||
|
|
||
|
<pre>
|
||
|
od -N50 output.txt
|
||
|
</pre>
|
||
|
</li>
|
||
|
|
||
|
<li>Skip the first 100 bytes and then dump the rest of a file.
|
||
|
|
||
|
<pre>
|
||
|
od -j100 output.txt
|
||
|
</pre>
|
||
|
</li>
|
||
|
|
||
|
<li>Dump a file in both hexadecimal and character format.
|
||
|
|
||
|
<pre>
|
||
|
od -tx1 -tc output.txt
|
||
|
</pre>
|
||
|
</li>
|
||
|
|
||
|
</ol>
|
||
|
|
||
|
<!-- end ibmbody========================================================= -->
|
||
|
</body>
|
||
|
</html>
|
||
|
|