⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 od.html

📁 IEEE 1003.1-2003, Single Unix Specification v3
💻 HTML
📖 第 1 页 / 共 3 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta name="generator" content="HTML Tidy, see www.w3.org"><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><link type="text/css" rel="stylesheet" href="style.css"><!-- Generated by The Open Group's rhtm tool v1.2.1 --><!-- Copyright (c) 2001-2003 The Open Group, All Rights Reserved --><title>od</title></head><body bgcolor="white"><script type="text/javascript" language="JavaScript" src="../jscript/codes.js"></script><basefont size="3"> <a name="od"></a> <a name="tag_04_96"></a><!-- od --> <!--header start--><center><font size="2">The Open Group Base Specifications Issue 6<br>IEEE Std 1003.1, 2003 Edition<br>Copyright &copy; 2001-2003 The IEEE and The Open Group, All Rights reserved.</font></center><!--header end--><hr size="2" noshade><h4><a name="tag_04_96_01"></a>NAME</h4><blockquote>od - dump files in various formats</blockquote><h4><a name="tag_04_96_02"></a>SYNOPSIS</h4><blockquote class="synopsis"><p><code><tt>od</tt> <b>[</b><tt>-v</tt><b>][</b><tt>-A</tt> <i>address_base</i><b>][</b><tt>-j</tt> <i>skip</i><b>][</b><tt>-N</tt><i>count</i><b>][</b><tt>-t</tt> <i>type_string</i><b>]</b><tt>...<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt> <b>[</b><i>file</i><tt>...</tt><b>]</b><tt><br><br></tt></code></p><div class="box"><code><tt><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0"> od</tt> <b>[</b><tt>-bcdosx</tt><b>][</b><i>file</i><b>][[</b><tt>+</tt><b>]</b><i>offset</i><b>[</b><tt>.</tt><b>][</b><tt>b</tt><b>]]</b><tt><img src="../images/opt-end.gif" alt="[Option End]" border="0"></tt></code></div><tt><br></tt></blockquote><h4><a name="tag_04_96_03"></a>DESCRIPTION</h4><blockquote><p>The <i>od</i> utility shall write the contents of its input files to standard output in a user-specified format.</p></blockquote><h4><a name="tag_04_96_04"></a>OPTIONS</h4><blockquote><p>The <i>od</i> utility shall conform to the Base Definitions volume of IEEE&nbsp;Std&nbsp;1003.1-2001, <a href="../basedefs/xbd_chap12.html#tag_12_02">Section 12.2, Utility Syntax Guidelines</a>, except that the order of presentation of the<b>-t</b> options <sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0"> &nbsp;and the <b>-bcdosx</b> options <img src="../images/opt-end.gif" alt="[Option End]" border="0">is significant.</p><p>The following options shall be supported:</p><dl compact><dt><b>-A&nbsp;</b> <i>address_base</i></dt><dd><br>Specify the input offset base. See the EXTENDED DESCRIPTION section. The application shall ensure that the <i>address_base</i>option-argument is a character. The characters <tt>'d'</tt> , <tt>'o'</tt> , and <tt>'x'</tt> specify that the offset base shall bewritten in decimal, octal, or hexadecimal, respectively. The character <tt>'n'</tt> specifies that the offset shall not bewritten.</dd><dt><b>-b</b></dt><dd><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">Interpret bytes in octal. This shall be equivalent to <b>-t&nbsp;o1</b>. <img src="../images/opt-end.gif" alt="[Option End]"border="0"></dd><dt><b>-c</b></dt><dd><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">Interpret bytes as characters specified by the current setting of the <i>LC_CTYPE</i> category. Certain non-graphic charactersappear as C escapes: <tt>"NUL=\0"</tt> , <tt>"BS=\b"</tt> , <tt>"FF=\f"</tt> , <tt>"NL=\n"</tt> , <tt>"CR=\r"</tt> ,<tt>"HT=\t"</tt> ; others appear as 3-digit octal numbers. <img src="../images/opt-end.gif" alt="[Option End]" border="0"></dd><dt><b>-d</b></dt><dd><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">Interpret <i>word</i>s (two-byte units) in unsigned decimal. This shall be equivalent to <b>-t&nbsp;u2</b>. <img src="../images/opt-end.gif" alt="[Option End]" border="0"></dd><dt><b>-j&nbsp;</b> <i>skip</i></dt><dd>Jump over <i>skip</i> bytes from the beginning of the input. The <i>od</i> utility shall read or seek past the first<i>skip</i> bytes in the concatenated input files. If the combined input is not at least <i>skip</i> bytes long, the <i>od</i>utility shall write a diagnostic message to standard error and exit with a non-zero exit status. <p>By default, the <i>skip</i> option-argument shall be interpreted as a decimal number. With a leading 0x or 0X, the offset shallbe interpreted as a hexadecimal number; otherwise, with a leading <tt>'0'</tt> , the offset shall be interpreted as an octalnumber. Appending the character <tt>'b'</tt> , <tt>'k'</tt> , or <tt>'m'</tt> to offset shall cause it to be interpreted as amultiple of 512, 1024, or 1048576 bytes, respectively. If the <i>skip</i> number is hexadecimal, any appended <tt>'b'</tt> shall beconsidered to be the final hexadecimal digit.</p></dd><dt><b>-N&nbsp;</b> <i>count</i></dt><dd>Format no more than <i>count</i> bytes of input. By default, <i>count</i> shall be interpreted as a decimal number. With aleading 0x or 0X, <i>count</i> shall be interpreted as a hexadecimal number; otherwise, with a leading <tt>'0'</tt> , it shall beinterpreted as an octal number. If <i>count</i> bytes of input (after successfully skipping, if <b>-j</b> <i>skip</i> is specified)are not available, it shall not be considered an error; the <i>od</i> utility shall format the input that is available.</dd><dt><b>-o</b></dt><dd><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">Interpret <i>word</i>s (two-byte units) in octal. This shall be equivalent to <b>-t&nbsp;o2</b>. <img src="../images/opt-end.gif"alt="[Option End]" border="0"></dd><dt><b>-s</b></dt><dd><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">Interpret <i>word</i>s (two-byte units) in signed decimal. This shall be equivalent to <b>-t&nbsp;d2</b>. <img src="../images/opt-end.gif" alt="[Option End]" border="0"></dd><dt><b>-t&nbsp;</b> <i>type_string</i></dt><dd><br>Specify one or more output types. See the EXTENDED DESCRIPTION section. The application shall ensure that the <i>type_string</i>option-argument is a string specifying the types to be used when writing the input data. The string shall consist of the typespecification characters <tt>a</tt> , <tt>c</tt> , <tt>d</tt> , <tt>f</tt> , <tt>o</tt> , <tt>u</tt> , and <tt>x</tt> , specifyingnamed character, character, signed decimal, floating point, octal, unsigned decimal, and hexadecimal, respectively. The typespecification characters <tt>d</tt> , <tt>f</tt> , <tt>o</tt> , <tt>u</tt> , and <tt>x</tt> can be followed by an optional unsigneddecimal integer that specifies the number of bytes to be transformed by each instance of the output type. The type specificationcharacter <tt>f</tt> can be followed by an optional <tt>F</tt> , <tt>D</tt> , or <tt>L</tt> indicating that the conversion shouldbe applied to an item of type <b>float</b>, <b>double</b>, or <b>long double</b>, respectively. The type specification characters<tt>d</tt> , <tt>o</tt> , <tt>u</tt> , and <tt>x</tt> can be followed by an optional <tt>C</tt> , <tt>S</tt> , <tt>I</tt> , or<tt>L</tt> indicating that the conversion should be applied to an item of type <b>char</b>, <b>short</b>, <b>int</b>, or<b>long</b>, respectively. Multiple types can be concatenated within the same <i>type_string</i> and multiple <b>-t</b> options canbe specified. Output lines shall be written for each type specified in the order in which the type specification characters arespecified.</dd><dt><b>-v</b></dt><dd>Write all input data. Without the <b>-v</b> option, any number of groups of output lines, which would be identical to theimmediately preceding group of output lines (except for the byte offsets), shall be replaced with a line containing only anasterisk ( <tt>'*'</tt> ).</dd><dt><b>-x</b></dt><dd><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">Interpret <i>word</i>s (two-byte units) in hexadecimal. This shall be equivalent to <b>-t&nbsp;x2</b>. <img src="../images/opt-end.gif" alt="[Option End]" border="0"></dd></dl><p><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">Multiple types can be specified by using multiple <b>-bcdostx</b> options. Output lines are written for each type specified in theorder in which the types are specified. <img src="../images/opt-end.gif" alt="[Option End]" border="0"></p></blockquote><h4><a name="tag_04_96_05"></a>OPERANDS</h4><blockquote><p>The following operands shall be supported:</p><dl compact><dt><i>file</i></dt><dd>A pathname of a file to be read. If no <i>file</i> operands are specified, the standard input shall be used. <p>If there are no more than two operands, none of the <b>-A</b>, <b>-j</b>, <b>-N</b>, or <b>-t</b> options is specified, andeither of the following is true: the first character of the last operand is a plus sign ( <tt>'+'</tt> ), or there are two operandsand the first character of the last operand is numeric; <sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0"> &nbsp;the last operand shall be interpreted as an offset operand onXSI-conformant systems. <img src="../images/opt-end.gif" alt="[Option End]" border="0"> Under these conditions, the results areunspecified on systems that are not XSI-conformant systems.</p></dd><dt><b>[+]</b><i>offset</i><b>[.][b]</b></dt><dd><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">The <i>offset</i> operand specifies the offset in the file where dumping is to commence. This operand is normally interpreted asoctal bytes. If <tt>'.'</tt> is appended, the offset shall be interpreted in decimal. If <tt>'b'</tt> is appended, the offset shallbe interpreted in units of 512 bytes. <img src="../images/opt-end.gif" alt="[Option End]" border="0"></dd></dl></blockquote><h4><a name="tag_04_96_06"></a>STDIN</h4><blockquote><p>The standard input shall be used only if no <i>file</i> operands are specified. See the INPUT FILES section.</p></blockquote><h4><a name="tag_04_96_07"></a>INPUT FILES</h4><blockquote><p>The input files can be any file type.</p></blockquote><h4><a name="tag_04_96_08"></a>ENVIRONMENT VARIABLES</h4><blockquote><p>The following environment variables shall affect the execution of <i>od</i>:</p><dl compact><dt><i>LANG</i></dt><dd>Provide a default value for the internationalization variables that are unset or null. (See the Base Definitions volume ofIEEE&nbsp;Std&nbsp;1003.1-2001, <a href="../basedefs/xbd_chap08.html#tag_08_02">Section 8.2, Internationalization Variables</a> forthe precedence of internationalization variables used to determine the values of locale categories.)</dd><dt><i>LC_ALL</i></dt><dd>If set to a non-empty string value, override the values of all the other internationalization variables.</dd><dt><i>LC_CTYPE</i></dt><dd>Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte asopposed to multi-byte characters in arguments and input files).</dd><dt><i>LC_MESSAGES</i></dt><dd>Determine the locale that should be used to affect the format and contents of diagnostic messages written to standarderror.</dd><dt><i>LC_NUMERIC</i></dt><dd><br>Determine the locale for selecting the radix character used when writing floating-point formatted output.</dd><dt><i>NLSPATH</i></dt><dd><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">Determine the location of message catalogs for the processing of <i>LC_MESSAGES .</i> <img src="../images/opt-end.gif" alt="[Option End]" border="0"></dd></dl></blockquote><h4><a name="tag_04_96_09"></a>ASYNCHRONOUS EVENTS</h4><blockquote><p>Default.</p></blockquote><h4><a name="tag_04_96_10"></a>STDOUT</h4><blockquote><p>See the EXTENDED DESCRIPTION section.</p></blockquote><h4><a name="tag_04_96_11"></a>STDERR</h4><blockquote><p>The standard error shall be used only for diagnostic messages.</p></blockquote><h4><a name="tag_04_96_12"></a>OUTPUT FILES</h4><blockquote><p>None.</p></blockquote><h4><a name="tag_04_96_13"></a>EXTENDED DESCRIPTION</h4><blockquote><p>The <i>od</i> utility shall copy sequentially each input file to standard output, transforming the input data according to theoutput types specified by the <b>-t</b> option <sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0"> &nbsp;or the <b>-bcdosx</b> options. <img src="../images/opt-end.gif"alt="[Option End]" border="0"> If no output type is specified, the default output shall be as if <b>-t&nbsp;oS</b> had beenspecified.</p><p>The number of bytes transformed by the output type specifier <tt>c</tt> may be variable depending on the <i>LC_CTYPE</i>category.</p><p>The default number of bytes transformed by output type specifiers <tt>d</tt> , <tt>f</tt> , <tt>o</tt> , <tt>u</tt> , and<tt>x</tt> corresponds to the various C-language types as follows. If the <a href="../utilities/c99.html"><i>c99</i></a> compileris present on the system, these specifiers shall correspond to the sizes used by default in that compiler. Otherwise, these sizesmay vary among systems that conform to IEEE&nbsp;Std&nbsp;1003.1-2001.</p><ul><li><p>For the type specifier characters <tt>d</tt> , <tt>o</tt> , <tt>u</tt> , and <tt>x</tt> , the default number of bytes shallcorrespond to the size of the underlying implementation's basic integer type. For these specifier characters, the implementationshall support values of the optional number of bytes to be converted corresponding to the number of bytes in the C-language types<b>char</b>, <b>short</b>, <b>int</b>, and <b>long</b>. These numbers can also be specified by an application as the characters<tt>'C'</tt> , <tt>'S'</tt> , <tt>'I'</tt> , and <tt>'L'</tt> , respectively. The implementation shall also support the values 1,2, 4, and 8, even if it provides no C-Language types of those sizes. The implementation shall support the decimal valuecorresponding to the C-language type <b>long long</b>. The byte order used when interpreting numeric values isimplementation-defined, but shall correspond to the order in which a constant of the corresponding type is stored in memory on thesystem.</p></li><li><p>For the type specifier character <tt>f</tt> , the default number of bytes shall correspond to the number of bytes in theunderlying implementation's basic double precision floating-point data type. The implementation shall support values of theoptional number of bytes to be converted corresponding to the number of bytes in the C-language types <b>float,</b> <b>double</b>,and <b>long double</b>. These numbers can also be specified by an application as the characters <tt>'F'</tt> , <tt>'D'</tt> , and<tt>'L'</tt> , respectively.</p></li></ul><p>The type specifier character <tt>a</tt> specifies that bytes shall be interpreted as named characters from the InternationalReference Version (IRV) of the ISO/IEC&nbsp;646:1991 standard. Only the least significant seven bits of each byte shall be used forthis type specification. Bytes with the values listed in the following table shall be written using the corresponding names for

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -