{"id":5849,"date":"2022-12-20T18:57:38","date_gmt":"2022-12-20T21:57:38","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/od-man1p\/"},"modified":"2022-12-20T18:57:38","modified_gmt":"2022-12-20T21:57:38","slug":"od-man1p","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/od-man1p\/","title":{"rendered":"OD (man1p)"},"content":{"rendered":"<h1 align=\"center\">OD<\/h1>\n<p> <a href=\"#PROLOG\">PROLOG<\/a><br \/> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#SYNOPSIS\">SYNOPSIS<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#OPTIONS\">OPTIONS<\/a><br \/> <a href=\"#OPERANDS\">OPERANDS<\/a><br \/> <a href=\"#STDIN\">STDIN<\/a><br \/> <a href=\"#INPUT FILES\">INPUT FILES<\/a><br \/> <a href=\"#ENVIRONMENT VARIABLES\">ENVIRONMENT VARIABLES<\/a><br \/> <a href=\"#ASYNCHRONOUS EVENTS\">ASYNCHRONOUS EVENTS<\/a><br \/> <a href=\"#STDOUT\">STDOUT<\/a><br \/> <a href=\"#STDERR\">STDERR<\/a><br \/> <a href=\"#OUTPUT FILES\">OUTPUT FILES<\/a><br \/> <a href=\"#EXTENDED DESCRIPTION\">EXTENDED DESCRIPTION<\/a><br \/> <a href=\"#EXIT STATUS\">EXIT STATUS<\/a><br \/> <a href=\"#CONSEQUENCES OF ERRORS\">CONSEQUENCES OF ERRORS<\/a><br \/> <a href=\"#APPLICATION USAGE\">APPLICATION USAGE<\/a><br \/> <a href=\"#EXAMPLES\">EXAMPLES<\/a><br \/> <a href=\"#RATIONALE\">RATIONALE<\/a><br \/> <a href=\"#FUTURE DIRECTIONS\">FUTURE DIRECTIONS<\/a><br \/> <a href=\"#SEE ALSO\">SEE ALSO<\/a><br \/> <a href=\"#COPYRIGHT\">COPYRIGHT<\/a> <\/p>\n<hr>\n<h2>PROLOG <a name=\"PROLOG\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">This manual page is part of the POSIX Programmer\u2019s Manual. The Linux implementation of this interface may differ (consult the corresponding Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux.<\/p>\n<h2>NAME <a name=\"NAME\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">od \u2014 dump files in various formats<\/p>\n<h2>SYNOPSIS <a name=\"SYNOPSIS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">od <b>[<\/b>-v<b>] [<\/b>-A <i>address_base<\/i><b>] [<\/b>-j <i>skip<\/i><b>] [<\/b>-N <i>count<\/i><b>] [<\/b>-t <i>type_string<\/i><b>]<\/b>&#8230; <b><br \/> [<\/b><i>file<\/i>&#8230;<b>]<\/b><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">od <b>[<\/b>-bcdosx<b>] [<\/b><i>file<\/i><b>] [[<\/b>+<b>]<\/b><i>offset<\/i><b>[<\/b>.<b>][<\/b>b<b>]]<\/b><\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The <i>od<\/i> utility shall write the contents of its input files to standard output in a user-specified format.<\/p>\n<h2>OPTIONS <a name=\"OPTIONS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The <i>od<\/i> utility shall conform to the Base Definitions volume of POSIX.1-2017, <i>Section 12.2<\/i>, <i>Utility Syntax Guidelines<\/i>, except that the order of presentation of the <b>\u2212t<\/b> options and the <b>\u2212bcdosx<\/b> options is significant.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The following options shall be supported: <b><br \/> \u2212A\u00a0<\/b><i>address_base<\/i><\/p>\n<p style=\"margin-left:26%;\">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 <b>\u2019d\u2019<\/b>, <b>\u2019o\u2019<\/b>, and <b>\u2019x\u2019<\/b> specify that the offset base shall be written in decimal, octal, or hexadecimal, respectively. The character <b>\u2019n\u2019<\/b> specifies that the offset shall not be written.<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"11%\">\n<p><b>\u2212b<\/b><\/p>\n<\/td>\n<td width=\"4%\"><\/td>\n<td width=\"74%\">\n<p>Interpret bytes in octal. This shall be equivalent to <b>\u2212t\u00a0o1<\/b>.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"11%\">\n<p><b>\u2212c<\/b><\/p>\n<\/td>\n<td width=\"4%\"><\/td>\n<td width=\"74%\">\n<p>Interpret bytes as characters specified by the current setting of the <i>LC_CTYPE<\/i> category. Certain non-graphic characters appear as C escapes: <b>&#8220;NUL=\u0000&#8221;<\/b>, <b>&#8220;BS=b&#8221;<\/b>, <b>&#8220;FF=f&#8221;<\/b>, <b>&#8220;NL=n&#8221;<\/b>, <b>&#8220;CR=r&#8221;<\/b>, <b>&#8220;HT=t&#8221;<\/b>; others appear as 3-digit octal numbers.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"11%\">\n<p><b>\u2212d<\/b><\/p>\n<\/td>\n<td width=\"4%\"><\/td>\n<td width=\"74%\">\n<p>Interpret <i>word<\/i>s (two-byte units) in unsigned decimal. This shall be equivalent to <b>\u2212t\u00a0u2<\/b>.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"11%\">\n<p><b>\u2212j\u00a0<\/b><i>skip<\/i><\/p>\n<\/td>\n<td width=\"4%\"><\/td>\n<td width=\"74%\">\n<p>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>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:26%; margin-top: 1em\">By default, the <i>skip<\/i> option-argument shall be interpreted as a decimal number. With a leading 0x or 0X, the offset shall be interpreted as a hexadecimal number; otherwise, with a leading <b>\u20190\u2019<\/b>, the offset shall be interpreted as an octal number. Appending the character <b>\u2019b\u2019<\/b>, <b>\u2019k\u2019<\/b>, or <b>\u2019m\u2019<\/b> to offset shall cause it to be interpreted as a multiple of 512, 1024, or 1048576 bytes, respectively. If the <i>skip<\/i> number is hexadecimal, any appended <b>\u2019b\u2019<\/b> shall be considered to be the final hexadecimal digit.<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"12%\">\n<p style=\"margin-top: 1em\"><b>\u2212N\u00a0<\/b><i>count<\/i><\/p>\n<\/td>\n<td width=\"3%\"><\/td>\n<td width=\"74%\">\n<p style=\"margin-top: 1em\">Format no more than <i>count<\/i> bytes of input. By default, <i>count<\/i> shall be interpreted as a decimal number. With a leading 0x or 0X, <i>count<\/i> shall be interpreted as a hexadecimal number; otherwise, with a leading <b>\u20190\u2019<\/b>, it shall be interpreted as an octal number. If <i>count<\/i> bytes of input (after successfully skipping, if <b>\u2212j<\/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.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"12%\">\n<p><b>\u2212o<\/b><\/p>\n<\/td>\n<td width=\"3%\"><\/td>\n<td width=\"74%\">\n<p>Interpret <i>word<\/i>s (two-byte units) in octal. This shall be equivalent to <b>\u2212t\u00a0o2<\/b>.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"12%\">\n<p><b>\u2212s<\/b><\/p>\n<\/td>\n<td width=\"3%\"><\/td>\n<td width=\"74%\">\n<p>Interpret <i>word<\/i>s (two-byte units) in signed decimal. This shall be equivalent to <b>\u2212t\u00a0d2<\/b>.<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:11%;\"><b>\u2212t\u00a0<\/b><i>type_string<\/i><\/p>\n<p style=\"margin-left:26%;\">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 type specification characters <b>a<\/b>, <b>c<\/b>, <b>d<\/b>, <b>f<\/b>, <b>o<\/b>, <b>u<\/b>, and <b>x<\/b>, specifying named character, character, signed decimal, floating point, octal, unsigned decimal, and hexadecimal, respectively. The type specification characters <b>d<\/b>, <b>f<\/b>, <b>o<\/b>, <b>u<\/b>, and <b>x<\/b> 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 <b>f<\/b> can be followed by an optional <b>F<\/b>, <b>D<\/b>, or <b>L<\/b> indicating that the conversion should be applied to an item of type <b>float<\/b>, <b>double<\/b>, or <b>long double<\/b>, respectively. The type specification characters <b>d<\/b>, <b>o<\/b>, <b>u<\/b>, and <b>x<\/b> can be followed by an optional <b>C<\/b>, <b>S<\/b>, <b>I<\/b>, or <b>L<\/b> 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>\u2212t<\/b> options can be specified. Output lines shall be written for each type specified in the order in which the type specification characters are specified.<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"3%\">\n<p><b>\u2212v<\/b><\/p>\n<\/td>\n<td width=\"12%\"><\/td>\n<td width=\"74%\">\n<p>Write all input data. Without the <b>\u2212v<\/b> option, any number of groups of output lines, which would be identical to the immediately preceding group of output lines (except for the byte offsets), shall be replaced with a line containing only an <asterisk> (<b>\u2019*\u2019<\/b>).<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"3%\">\n<p><b>\u2212x<\/b><\/p>\n<\/td>\n<td width=\"12%\"><\/td>\n<td width=\"74%\">\n<p>Interpret <i>word<\/i>s (two-byte units) in hexadecimal. This shall be equivalent to <b>\u2212t\u00a0x2<\/b>.<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:11%; margin-top: 1em\">Multiple types can be specified by using multiple <b>\u2212bcdostx<\/b> options. Output lines are written for each type specified in the order in which the types are specified.<\/p>\n<h2>OPERANDS <a name=\"OPERANDS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The following operands shall be supported:<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"6%\">\n<p style=\"margin-top: 1em\"><i>file<\/i><\/p>\n<\/td>\n<td width=\"9%\"><\/td>\n<td width=\"74%\">\n<p style=\"margin-top: 1em\">A pathname of a file to be read. If no <i>file<\/i> operands are specified, the standard input shall be used.<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:26%; margin-top: 1em\">If there are no more than two operands, none of the <b>\u2212A<\/b>, <b>\u2212j<\/b>, <b>\u2212N<\/b>, <b>\u2212t<\/b>, or <b>\u2212v<\/b> options is specified, and either of the following is true: the first character of the last operand is a <plus-sign> (<b>\u2019+\u2019<\/b>), or there are two operands and the first character of the last operand is numeric; the last operand shall be interpreted as an offset operand on XSI-conformant systems. Under these conditions, the results are unspecified on systems that are not XSI-conformant systems.<\/p>\n<p style=\"margin-left:11%;\"><b>[+]<\/b><i>offset<\/i><b>[.][b]<\/b><\/p>\n<p style=\"margin-left:26%;\">The <i>offset<\/i> operand specifies the offset in the file where dumping is to commence. This operand is normally interpreted as octal bytes. If <b>\u2019.\u2019<\/b> is appended, the offset shall be interpreted in decimal. If <b>\u2019b\u2019<\/b> is appended, the offset shall be interpreted in units of 512 bytes.<\/p>\n<h2>STDIN <a name=\"STDIN\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The standard input shall be used if no <i>file<\/i> operands are specified, and shall be used if a <i>file<\/i> operand is <b>\u2019\u2212\u2019<\/b> and the implementation treats the <b>\u2019\u2212\u2019<\/b> as meaning standard input. Otherwise, the standard input shall not be used. See the INPUT FILES section.<\/p>\n<h2>INPUT FILES <a name=\"INPUT FILES\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The input files can be any file type.<\/p>\n<h2>ENVIRONMENT VARIABLES <a name=\"ENVIRONMENT VARIABLES\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The following environment variables shall affect the execution of <i>od<\/i>:<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"12%\">\n<p><i>LANG<\/i><\/p>\n<\/td>\n<td width=\"3%\"><\/td>\n<td width=\"74%\">\n<p>Provide a default value for the internationalization variables that are unset or null. (See the Base Definitions volume of POSIX.1-2017, <i>Section 8.2<\/i>, <i>Internationalization Variables<\/i> for the precedence of internationalization variables used to determine the values of locale categories.)<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"12%\">\n<p><i>LC_ALL<\/i><\/p>\n<\/td>\n<td width=\"3%\"><\/td>\n<td width=\"74%\">\n<p>If set to a non-empty string value, override the values of all the other internationalization variables.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"12%\">\n<p><i>LC_CTYPE<\/i><\/p>\n<\/td>\n<td width=\"3%\"><\/td>\n<td width=\"74%\">\n<p>Determine 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 and input files).<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:11%;\"><i>LC_MESSAGES<\/i><\/p>\n<p style=\"margin-left:26%;\">Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error.<\/p>\n<p style=\"margin-left:11%;\"><i>LC_NUMERIC<\/i><\/p>\n<p style=\"margin-left:26%;\">Determine the locale for selecting the radix character used when writing floating-point formatted output.<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"11%\">\n<p><i>NLSPATH<\/i><\/p>\n<\/td>\n<td width=\"4%\"><\/td>\n<td width=\"74%\">\n<p>Determine the location of message catalogs for the processing of <i>LC_MESSAGES<\/i>.<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<h2>ASYNCHRONOUS EVENTS <a name=\"ASYNCHRONOUS EVENTS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Default.<\/p>\n<h2>STDOUT <a name=\"STDOUT\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">See the EXTENDED DESCRIPTION section.<\/p>\n<h2>STDERR <a name=\"STDERR\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The standard error shall be used only for diagnostic messages.<\/p>\n<h2>OUTPUT FILES <a name=\"OUTPUT FILES\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">None.<\/p>\n<h2>EXTENDED DESCRIPTION <a name=\"EXTENDED DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The <i>od<\/i> utility shall copy sequentially each input file to standard output, transforming the input data according to the output types specified by the <b>\u2212t<\/b> option or the <b>\u2212bcdosx<\/b> options. If no output type is specified, the default output shall be as if <b>\u2212t\u00a0oS<\/b> had been specified.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The number of bytes transformed by the output type specifier <b>c<\/b> may be variable depending on the <i>LC_CTYPE<\/i> category.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The default number of bytes transformed by output type specifiers <b>d<\/b>, <b>f<\/b>, <b>o<\/b>, <b>u<\/b>, and <b>x<\/b> corresponds to the various C-language types as follows. If the <i>c99<\/i> compiler is present on the system, these specifiers shall correspond to the sizes used by default in that compiler. Otherwise, these sizes may vary among systems that conform to POSIX.1-2008.<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"12%\"><\/td>\n<td width=\"2%\">\n<p style=\"margin-top: 1em\">*<\/p>\n<\/td>\n<td width=\"3%\"><\/td>\n<td width=\"83%\">\n<p style=\"margin-top: 1em\">For the type specifier characters <b>d<\/b>, <b>o<\/b>, <b>u<\/b>, and <b>x<\/b>, the default number of bytes shall correspond to the size of the underlying implementation\u2019s basic integer type. For these specifier characters, the implementation shall 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 <b>\u2019C\u2019<\/b>, <b>\u2019S\u2019<\/b>, <b>\u2019I\u2019<\/b>, and <b>\u2019L\u2019<\/b>, 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 value corresponding to the C-language type <b>long long<\/b>. The byte order used when interpreting numeric values is implementation-defined, but shall correspond to the order in which a constant of the corresponding type is stored in memory on the system.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"12%\"><\/td>\n<td width=\"2%\">\n<p>*<\/p>\n<\/td>\n<td width=\"3%\"><\/td>\n<td width=\"83%\">\n<p>For the type specifier character <b>f<\/b>, the default number of bytes shall correspond to the number of bytes in the underlying implementation\u2019s basic double precision floating-point data type. The implementation shall support values of the optional number of bytes to be converted corresponding to the number of bytes in the C-language types <b>float, double<\/b>, and <b>long double<\/b>. These numbers can also be specified by an application as the characters <b>\u2019F\u2019<\/b>, <b>\u2019D\u2019<\/b>, and <b>\u2019L\u2019<\/b>, respectively.<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:11%; margin-top: 1em\">The type specifier character <b>a<\/b> specifies that bytes shall be interpreted as named characters from the International Reference Version (IRV) of the ISO\/IEC\u00a0646:1991 standard. Only the least significant seven bits of each byte shall be used for this type specification. Bytes with the values listed in the following table shall be written using the corresponding names for those characters.<\/p>\n<p align=\"center\" style=\"margin-top: 1em\"><b>Table: Named Characters in<\/b> <i>od<\/i><\/p>\n<p align=\"center\" style=\"margin-top: 1em\"><i><img decoding=\"async\" src=\"grohtml-890381.png\" alt=\"Image grohtml-890381.png\"><\/i><\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"7%\">\n<p style=\"margin-top: 1em\"><b>Note:<\/b><\/p>\n<\/td>\n<td width=\"8%\"><\/td>\n<td width=\"74%\">\n<p style=\"margin-top: 1em\">The <b>&#8220;\u000012&#8221;<\/b> value may be written either as <b>lf<\/b> or <b>nl<\/b>.<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:11%; margin-top: 1em\">The type specifier character <b>c<\/b> specifies that bytes shall be interpreted as characters specified by the current setting of the <i>LC_CTYPE<\/i> locale category. Characters listed in the table in the Base Definitions volume of POSIX.1-2017, <i>Chapter 5<\/i>, <i>File Format Notation<\/i> (<b>\u2019\\\u2019<\/b>, <b>\u2019a\u2019<\/b>, <b>\u2019b\u2019<\/b>, <b>\u2019f\u2019<\/b>, <b>\u2019n\u2019<\/b>, <b>\u2019r\u2019<\/b>, <b>\u2019t\u2019<\/b>, <b>\u2019v\u2019<\/b>) shall be written as the corresponding escape sequences, except that <backslash> shall be written as a single <backslash> and a NUL shall be written as <b>\u2019\u0000\u2019<\/b>. Other non-printable characters shall be written as one three-digit octal number for each byte in the character. Printable multi-byte characters shall be written in the area corresponding to the first byte of the character; the two-character sequence <b>&#8220;**&#8221;<\/b> shall be written in the area corresponding to each remaining byte in the character, as an indication that the character is continued. When either the <b>\u2212j<\/b> <i>skip<\/i> or <b>\u2212N<\/b> <i>count<\/i> option is specified along with the <b>c<\/b> type specifier, and this results in an attempt to start or finish in the middle of a multi-byte character, the result is implementation-defined.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The input data shall be manipulated in blocks, where a block is defined as a multiple of the least common multiple of the number of bytes transformed by the specified output types. If the least common multiple is greater than 16, the results are unspecified. Each input block shall be written as transformed by each output type, one per written line, in the order that the output types were specified. If the input block size is larger than the number of bytes transformed by the output type, the output type shall sequentially transform the parts of the input block, and the output from each of the transformations shall be separated by one or more <blank> characters.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">If, as a result of the specification of the <b>\u2212N<\/b> option or end-of-file being reached on the last input file, input data only partially satisfies an output type, the input shall be extended sufficiently with null bytes to write the last byte of the input.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Unless <b>\u2212A\u00a0n<\/b> is specified, the first output line produced for each input block shall be preceded by the input offset, cumulative across input files, of the next byte to be written. The format of the input offset is unspecified; however, it shall not contain any <blank> characters, shall start at the first character of the output line, and shall be followed by one or more <blank> characters. In addition, the offset of the byte following the last byte written shall be written after all the input data has been processed, but shall not be followed by any <blank> characters.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">If no <b>\u2212A<\/b> option is specified, the input offset base is unspecified.<\/p>\n<h2>EXIT STATUS <a name=\"EXIT STATUS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The following exit values shall be returned:<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"3%\">\n<p style=\"margin-top: 1em\">0<\/p>\n<\/td>\n<td width=\"6%\"><\/td>\n<td width=\"68%\">\n<p style=\"margin-top: 1em\">All input files were processed successfully.<\/p>\n<\/td>\n<td width=\"12%\"> <\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"3%\">\n<p>>0<\/p>\n<\/td>\n<td width=\"6%\"><\/td>\n<td width=\"68%\">\n<p>An error occurred.<\/p>\n<\/td>\n<td width=\"12%\"> <\/td>\n<\/tr>\n<\/table>\n<h2>CONSEQUENCES OF ERRORS <a name=\"CONSEQUENCES OF ERRORS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Default.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><i>The following sections are informative.<\/i><\/p>\n<h2>APPLICATION USAGE <a name=\"APPLICATION USAGE\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">XSI-conformant applications are warned not to use filenames starting with <b>\u2019+\u2019<\/b> or a first operand starting with a numeric character so that the old functionality can be maintained by implementations, unless they specify one of the <b>\u2212A<\/b>, <b>\u2212j<\/b>, or <b>\u2212N<\/b> options. To guarantee that one of these filenames is always interpreted as a filename, an application could always specify the address base format with the <b>\u2212A<\/b> option.<\/p>\n<h2>EXAMPLES <a name=\"EXAMPLES\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">If a file containing 128 bytes with decimal values zero to 127, in increasing order, is supplied as standard input to the command:<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">od -A d -t a<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">on an implementation using an input block size of 16 bytes, the standard output, independent of the current locale setting, would be similar to:<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">0000000 nul soh stx etx eot enq ack bel bs ht nl vt ff cr so si <br \/> 0000016 dle dc1 dc2 dc3 dc4 nak syn etb can em sub esc fs gs rs us <br \/> 0000032 sp ! &#8221; # $ % &#038; &#8216; ( ) bodies manpages.csv script_extrae_body.sh script.sh usr + , &#8211; . \/ <br \/> 0000048 0 1 2 3 4 5 6 7 8 9 : ; < = > ? <br \/> 0000064 @ A B C D E F G H I J K L M N O <br \/> 0000080 P Q R S T U V W X Y Z [  ] ^ _ <br \/> 0000096 \u2018 a b c d e f g h i j k l m n o <br \/> 0000112 p q r s t u v w x y z { | } ~ del <br \/> 0000128<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Note that this volume of POSIX.1-2017 allows <b>nl<\/b> or <b>lf<\/b> to be used as the name for the ISO\/IEC\u00a0646:1991 standard IRV character with decimal value 10. The IRV names this character <b>lf<\/b> (line feed), but traditional implementations have referred to this character as newline (<b>nl<\/b>) and the POSIX locale character set symbolic name for the corresponding character is a <newline>.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The command:<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">od -A o -t o2x2x -N 18<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">on a system with 32-bit words and an implementation using an input block size of 16 bytes could write 18 bytes in approximately the following format:<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">0000000 032056 031440 041123 042040 052516 044530 020043 031464 <br \/> 342e 3320 4253 4420 554e 4958 2023 3334 <br \/> 342e3320 42534420 554e4958 20233334 <br \/> 0000020 032472 <br \/> 353a <br \/> 353a0000 <br \/> 0000022<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The command:<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">od -A d -t f -t o4 -t x4 -N 24 -j 0x15<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">on a system with 64-bit doubles (for example, IEEE\u00a0Std\u00a0754-1985 double precision floating-point format) would skip 21 bytes of input data and then write 24 bytes in approximately the following format:<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">0000000 1.00000000000000e+00 1.57350000000000e+01 <br \/> 07774000000 00000000000 10013674121 35341217270 <br \/> 3ff00000 00000000 402f3851 eb851eb8 <br \/> 0000016 1.40668230000000e+02 <br \/> 10030312542 04370303230 <br \/> 40619562 23e18698 <br \/> 0000024<\/p>\n<h2>RATIONALE <a name=\"RATIONALE\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The <i>od<\/i> utility went through several names in early proposals, including <i>hd<\/i>, <i>xd<\/i>, and most recently <i>hexdump<\/i>. There were several objections to all of these based on the following reasons:<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"12%\"><\/td>\n<td width=\"2%\">\n<p style=\"margin-top: 1em\">*<\/p>\n<\/td>\n<td width=\"3%\"><\/td>\n<td width=\"83%\">\n<p style=\"margin-top: 1em\">The <i>hd<\/i> and <i>xd<\/i> names conflicted with historical utilities that behaved differently.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"12%\"><\/td>\n<td width=\"2%\">\n<p>*<\/p>\n<\/td>\n<td width=\"3%\"><\/td>\n<td width=\"83%\">\n<p>The <i>hexdump<\/i> description was much more complex than needed for a simple dump utility.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"12%\"><\/td>\n<td width=\"2%\">\n<p>*<\/p>\n<\/td>\n<td width=\"3%\"><\/td>\n<td width=\"83%\">\n<p>The <i>od<\/i> utility has been available on all historical implementations and there was no need to create a new name for a utility so similar to the historical <i>od<\/i> utility.<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:11%; margin-top: 1em\">The original reasons for not standardizing historical <i>od<\/i> were also fairly widespread. Those reasons are given below along with rationale explaining why the standard developers believe that this version does not suffer from the indicated problem:<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"12%\"><\/td>\n<td width=\"2%\">\n<p style=\"margin-top: 1em\">*<\/p>\n<\/td>\n<td width=\"3%\"><\/td>\n<td width=\"83%\">\n<p style=\"margin-top: 1em\">The BSD and System V versions of <i>od<\/i> have diverged, and the intersection of features provided by both does not meet the needs of the user community. In fact, the System V version only provides a mechanism for dumping octal bytes and <b>short<\/b>s, signed and unsigned decimal <b>short<\/b>s, hexadecimal <b>short<\/b>s, and ASCII characters. BSD added the ability to dump <b>float<\/b>s, <b>double<\/b>s, named ASCII characters, and octal, signed decimal, unsigned decimal, and hexadecimal <b>long<\/b>s. The version presented here provides more normalized forms for dumping bytes, <b>short<\/b>s, <b>int<\/b>s, and <b>long<\/b>s in octal, signed decimal, unsigned decimal, and hexadecimal; <b>float<\/b>, <b>double<\/b>, and <b>long double<\/b>; and named ASCII as well as current locale characters.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"12%\"><\/td>\n<td width=\"2%\">\n<p>*<\/p>\n<\/td>\n<td width=\"3%\"><\/td>\n<td width=\"83%\">\n<p>It would not be possible to come up with a compatible superset of the BSD and System V flags that met the requirements of the standard developers. The historical default <i>od<\/i> output is the specified default output of this utility. None of the option letters chosen for this version of <i>od<\/i> conflict with any of the options to historical versions of <i>od<\/i>.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"12%\"><\/td>\n<td width=\"2%\">\n<p>*<\/p>\n<\/td>\n<td width=\"3%\"><\/td>\n<td width=\"83%\">\n<p>On systems with different sizes for <b>short<\/b>, <b>int<\/b>, and <b>long<\/b>, there was no way to ask for dumps of <b>int<\/b>s, even in the BSD version. Because of the way options are named, the name space could not be extended to solve these problems. This is why the <b>\u2212t<\/b> option was added (with type specifiers more closely matched to the <i>printf<\/i>() formats used in the rest of this volume of POSIX.1-2017) and the optional field sizes were added to the <b>d<\/b>, <b>f<\/b>, <b>o<\/b>, <b>u<\/b>, and <b>x<\/b> type specifiers. It is also one of the reasons why the historical practice was not mandated as a required obsolescent form of <i>od<\/i>. (Although the old versions of <i>od<\/i> are not listed as an obsolescent form, implementations are urged to continue to recognize the older forms for several more years.) The <b>a<\/b>, <b>c<\/b>, <b>f<\/b>, <b>o<\/b>, and <b>x<\/b> types match the meaning of the corresponding format characters in the historical implementations of <i>od<\/i> except for the default sizes of the fields converted. The <b>d<\/b> format is signed in this volume of POSIX.1-2017 to match the <i>printf<\/i>() notation. (Historical versions of <i>od<\/i> used <b>d<\/b> as a synonym for <b>u<\/b> in this version. The System V implementation uses <b>s<\/b> for signed decimal; BSD uses <b>i<\/b> for signed decimal and <b>s<\/b> for null-terminated strings.) Other than <b>d<\/b> and <b>u<\/b>, all of the type specifiers match format characters in the historical BSD version of <b>od<\/b>.<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:17%; margin-top: 1em\">The sizes of the C-language types <b>char<\/b>, <b>short<\/b>, <b>int<\/b>, <b>long<\/b>, <b>float<\/b>, <b>double<\/b>, and <b>long double<\/b> are used even though it is recognized that there may be zero or more than one compiler for the C language on an implementation and that they may use different sizes for some of these types. (For example, one compiler might use 2 bytes <b>short<\/b>s, 2 bytes <b>int<\/b>s, and 4 bytes <b>long<\/b>s, while another compiler (or an option to the same compiler) uses 2 bytes <b>short<\/b>s, 4 bytes <b>int<\/b>s, and 4 bytes <b>long<\/b>s.) Nonetheless, there has to be a basic size known by the implementation for these types, corresponding to the values reported by invocations of the <i>getconf<\/i> utility when called with <i>system_var<\/i> operands {UCHAR_MAX}, {USHORT_MAX}, {UINT_MAX}, and {ULONG_MAX} for the types <b>char<\/b>, <b>short<\/b>, <b>int<\/b>, and <b>long<\/b>, respectively. There are similar constants required by the ISO\u00a0C standard, but not required by the System Interfaces volume of POSIX.1-2017 or this volume of POSIX.1-2017. They are {FLT_MANT_DIG}, {DBL_MANT_DIG}, and {LDBL_MANT_DIG} for the types <b>float<\/b>, <b>double<\/b>, and <b>long double<\/b>, respectively. If the optional <i>c99<\/i> utility is provided by the implementation and used as specified by this volume of POSIX.1-2017, these are the sizes that would be provided. If an option is used that specifies different sizes for these types, there is no guarantee that the <i>od<\/i> utility is able to interpret binary data output by such a program correctly.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">This volume of POSIX.1-2017 requires that the numeric values of these lengths be recognized by the <i>od<\/i> utility and that symbolic forms also be recognized. Thus, a conforming application can always look at an array of <b>unsigned long<\/b> data elements using <i>od<\/i> <b>\u2212t<\/b> <i>uL<\/i>.<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"12%\"><\/td>\n<td width=\"2%\">\n<p style=\"margin-top: 1em\">*<\/p>\n<\/td>\n<td width=\"3%\"><\/td>\n<td width=\"83%\">\n<p style=\"margin-top: 1em\">The method of specifying the format for the address field based on specifying a starting offset in a file unnecessarily tied the two together. The <b>\u2212A<\/b> option now specifies the address base and the <b>\u2212S<\/b> option specifies a starting offset.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"12%\"><\/td>\n<td width=\"2%\">\n<p>*<\/p>\n<\/td>\n<td width=\"3%\"><\/td>\n<td width=\"83%\">\n<p>It would be difficult to break the dependence on US ASCII to achieve an internationalized utility. It does not seem to be any harder for <i>od<\/i> to dump characters in the current locale than it is for the <i>ed<\/i> or <i>sed<\/i> <b>l<\/b> commands. The <b>c<\/b> type specifier does this without difficulty and is completely compatible with the historical implementations of the <b>c<\/b> format character when the current locale uses a superset of the ISO\/IEC\u00a0646:1991 standard as a codeset. The <b>a<\/b> type specifier (from the BSD <b>a<\/b> format character) was left as a portable means to dump ASCII (or more correctly ISO\/IEC\u00a0646:1991 standard (IRV)) so that headers produced by <i>pax<\/i> could be deciphered even on systems that do not use the ISO\/IEC\u00a0646:1991 standard as a subset of their base codeset.<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:11%; margin-top: 1em\">The use of <b>&#8220;**&#8221;<\/b> as an indication of continuation of a multi-byte character in <b>c<\/b> specifier output was chosen based on seeing an implementation that uses this method. The continuation bytes have to be marked in a way that is not ambiguous with another single-byte or multi-byte character.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">An early proposal used <b>\u2212S<\/b> and <b>\u2212n<\/b>, respectively, for the <b>\u2212j<\/b> and <b>\u2212N<\/b> options eventually selected. These were changed to avoid conflicts with historical implementations.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The original standard specified <b>\u2212t o2<\/b> as the default when no output type was given. This was changed to <b>\u2212t oS<\/b> (the length of a <b>short<\/b>) to accommodate a supercomputer implementation that historically used 64 bits as its default (and that defined shorts as 64 bits). This change should not affect conforming applications. The requirement to support lengths of 1, 2, and 4 was added at the same time to address an historical implementation that had no two-byte data types in its C compiler.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The use of a basic integer data type is intended to allow the implementation to choose a word size commonly used by applications on that architecture.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Earlier versions of this standard allowed for implementations with bytes other than eight bits, but this has been modified in this version.<\/p>\n<h2>FUTURE DIRECTIONS <a name=\"FUTURE DIRECTIONS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">All option and operand interfaces marked XSI may be removed in a future version.<\/p>\n<h2>SEE ALSO <a name=\"SEE ALSO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><i>c99<\/i>, <i>sed<\/i><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The Base Definitions volume of POSIX.1-2017, <i>Chapter 5<\/i>, <i>File Format Notation<\/i>, <i>Chapter 8<\/i>, <i>Environment Variables<\/i>, <i>Section 12.2<\/i>, <i>Utility Syntax Guidelines<\/i><\/p>\n<h2>COPYRIGHT <a name=\"COPYRIGHT\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology &#8212; Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http:\/\/www.opengroup.org\/unix\/online.html .<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https:\/\/www.kernel.org\/doc\/man-pages\/reporting_bugs.html .<\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  od \u2014 dump files in various formats <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3782,1],"tags":[2511,2586],"class_list":["post-5849","post","type-post","status-publish","format-standard","hentry","category-1p-posix-comandos-generales","category-sin-categoria","tag-man1p","tag-od"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/5849","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/comments?post=5849"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/5849\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=5849"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=5849"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=5849"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}