2 .\" Copyright 1989 AT&T Copyright (c) 1992, X/Open Company Limited All Rights Reserved Portions Copyright (c) 2005, Sun Microsystems, Inc. All Rights Reserved
3 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
4 .\" http://www.opengroup.org/bookstore/.
5 .\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions 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.
6 .\" This notice shall appear on any product containing this material.
7 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
8 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
9 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
10 .TH OD 1 "Oct 25, 2017"
16 \fB/usr/bin/od\fR [\fB-bcCDdFfOoSsvXx\fR] [\fIfile\fR] [\fIoffset_string\fR]
21 \fB/usr/bin/od\fR [\fB-bcCDdFfOoSsvXx\fR] [\fB-A\fR \fIaddress_base\fR]
22 [\fB-j\fR \fIskip\fR] [\fB-N\fR \fIcount\fR] [\fB-t\fR \fItype_string\fR]... [\fIfile\fR]...
28 The \fBod\fR command copies sequentially each input file to standard output and
29 transforms the input data according to the output types specified by the
30 \fB-t\fR or \fB-bcCDdFfOoSsvXx\fR options. If no output type is specified, the
31 default output is as if \fB-t\fR \fBo2\fR had been specified. Multiple types
32 can be specified by using multiple \fB-bcCDdFfOoSstvXx\fR options. Output lines
33 are written for each type specified in the order in which the types are
34 specified. If no \fIfile\fR is specified, the standard input is used. The
35 [\fIoffset_string\fR] operand is mutually exclusive from the \fB-A\fR,
36 \fB-j\fR, \fB-N\fR, and \fB-t\fR options. For the purposes of this description,
37 the following terms are used:
44 Refers to a 16-bit unit, independent of the word size of the machine.
53 Refers to a 32-bit unit.
59 \fBdouble long word\fR
62 Refers to a 64-bit unit.
68 The following options are supported:
72 \fB\fB-A\fR \fIaddress_base\fR \fR
75 Specifies the input offset base. The \fIaddress_base\fR option-argument must be
76 a character. The characters \fBd\fR, \fBo\fR and \fBx\fR specify that the
77 offset base will be written in decimal, octal or hexadecimal, respectively. The
78 character \fBn\fR specifies that the offset will not be written. Unless
79 \fB-A\fR \fBn\fR is specified, the output line will be preceded by the input
80 offset, cumulative across input files, of the next byte to be written. In
81 addition, the offset of the byte following the last byte written will be
82 displayed after all the input data has been processed. Without the \fB-A\fR
83 \fIaddress_base\fR option and the [\fIoffset_string\fR] operand, the input
84 offset base is displayed in octal.
93 Interprets bytes in octal. This is equivalent to \fB-t\fR \fBo1\fR.
102 Interprets bytes as single-byte or multibyte characters according to the
103 current setting of the \fBLC_CTYPE\fR locale category. Printable multibyte
104 characters are written in the area corresponding to the first byte of the
105 character. The two-character sequence \fB**\fR is written in the area
106 corresponding to each remaining byte in the character, as an indication that
107 the character is continued. Non-graphic characters appear the same as they
108 would using the \fB-C\fR option.
117 Interprets bytes as single-byte or multibyte characters according to the
118 current setting of the \fBLC_CTYPE\fR locale category. Printable multibyte
119 characters are written in the area corresponding to the first byte of the
120 character. The two-character sequence ** is written in the area corresponding
121 to each remaining byte in the character, as an indication that the character is
122 continued. Certain non-graphic characters appear as C escapes:
136 Other non-printable characters appear as one three-digit octal number for each
137 byte in the character.
146 Interprets words in unsigned decimal. This is equivalent to \fB-t\fR \fBu2\fR.
155 Interprets long words in unsigned decimal. This is equivalent to \fB-t\fR
165 Interprets long words in floating point. This is equivalent to \fB-t\fR
175 Interprets double long words in extended precision. This is equivalent to
182 \fB\fB-j\fR \fIskip\fR \fR
185 Jumps over \fIskip\fR bytes from the beginning of the input. The \fBod\fR
186 command will read or seek past the first \fIskip\fR bytes in the concatenated
187 input files. If the combined input is not at least \fIskip\fR bytes long, the
188 \fBod\fR command will write a diagnostic message to standard error and exit
189 with a non-zero exit status.
191 By default, the \fIskip\fR option-argument is interpreted as a decimal number.
192 With a leading \fB0x\fR or \fB0X\fR, the offset is interpreted as a hexadecimal
193 number; otherwise, with a leading \fB0\fR, the offset will be interpreted as an
194 octal number. Appending the character \fBb\fR, \fBk\fR, or \fBm\fR to offset
195 will cause it to be interpreted as a multiple of \fB512\fR, \fB1024\fR or
196 \fB1\|048\|576\fR bytes, respectively. If the \fIskip\fR number is hexadecimal,
197 any appended \fBb\fR is considered to be the final hexadecimal digit. The
198 address is displayed starting at \fB0000000\fR, and its base is not implied by
199 the base of the \fIskip\fR option-argument.
205 \fB\fB-N\fR \fIcount\fR \fR
208 Formats no more than \fIcount\fR bytes of input. By default, \fIcount\fR is
209 interpreted as a decimal number. With a leading \fB0x\fR or \fB0X\fR,
210 \fIcount\fR is interpreted as a hexadecimal number; otherwise, with a leading
211 \fB0\fR, it is interpreted as an octal number. If \fIcount\fR bytes of input
212 (after successfully skipping, if \fB-j\fR\fIskip\fR is specified) are not
213 available, it will not be considered an error. The \fBod\fR command will format
214 the input that is available. The base of the address displayed is not implied
215 by the base of the \fIcount\fR option-argument.
224 Interprets words in octal. This is equivalent to \fB-t\fR \fBo2\fR.
233 Interprets long words in unsigned octal. This is equivalent to \fB-t\fR
243 Interprets words in signed decimal. This is equivalent to \fB-t\fR \fBd2\fR.
252 Interprets long words in signed decimal. This is equivalent to \fB-t\fR
259 \fB\fB-t\fR \fItype_string\fR \fR
262 Specifies one or more output types. The \fItype_string\fR option-argument must
263 be a string specifying the types to be used when writing the input data. The
264 string must consist of the type specification characters:
271 \fINamed character\fR. Interprets bytes as named characters. Only the least
272 significant seven bits of each byte will be used for this type specification.
273 Bytes with the values listed in the following table will be written using the
274 corresponding names for those characters.
276 The following are named characters in \fBod\fR:
328 \fICharacter\fR. Interprets bytes as single-byte or multibyte characters
329 specified by the current setting of the \fBLC_CTYPE\fR locale category.
330 Printable multibyte characters are written in the area corresponding to the
331 first byte of the character. The two-character sequence \fB**\fR is written in
332 the area corresponding to each remaining byte in the character, as an
333 indication that the character is continued. Certain non-graphic characters
334 appear as C escapes: \fB\e0\fR, \fB\ea\fR, \fB\eb\fR, \fB\ef\fR, \fB\en\fR,
335 \fB\er\fR, \fB\et\fR, \fB\ev\fR\&. Other non-printable characters appear as one
336 three-digit octal number for each byte in the character.
339 The type specification characters \fBd\fR, \fBf\fR, \fBo\fR, \fBu\fR, and
340 \fBx\fR can be followed by an optional unsigned decimal integer that specifies
341 the number of bytes to be transformed by each instance of the output type.
348 \fIFloating point\fR. Can be followed by an optional \fBF\fR, \fBD\fR, or
349 \fBL\fR indicating that the conversion should be applied to an item of type
350 \fBfloat\fR, \fBdouble\fR, or \fBlong double\fR, respectively.
356 \fB\fBd\fR, \fBo\fR, \fBu\fR, and \fBx\fR\fR
359 \fISigned decimal\fR, \fIoctal\fR, \fIunsigned decimal\fR, and
360 \fIhexadecimal\fR, respectively. Can be followed by an optional \fBC\fR,
361 \fBS\fR, \fBI\fR, or \fBL\fR indicating that the conversion should be applied
362 to an item of type \fBchar\fR, \fBshort\fR, \fBint\fR, or \fBlong\fR,
366 Multiple types can be concatenated within the same \fItype_string\fR and
367 multiple \fB-t\fR options can be specified. Output lines are written for each
368 type specified in the order in which the type specification characters are
378 Shows all input data (verbose). Without the \fB-v\fR option, all groups of
379 output lines that would be identical to the immediately preceding output line
380 (except for byte offsets), will be replaced with a line containing only an
390 Interprets words in hex. This is equivalent to \fB-t\fR \fBx2\fR.
399 Interprets long words in hex. This is equivalent to \fB-t\fR \fBx4\fR.
405 The following operands are supported:
412 A path name of a file to be read. If no \fIfile\fR operands are specified, the
413 standard input will be used. If there are no more than two operands, none of
414 the \fB-A\fR, \fB-j\fR, \fB-N\fR, or \fB-t\fR options is specified, and
415 \fIany\fR of the following are true:
419 the first character of the last operand is a plus sign (+)
424 the first character of the second operand is numeric
429 the first character of the second operand is \fBx\fR and the second
430 character of the second operand is a lower-case hexadecimal character or digit
435 the second operand is named "\fBx\fR"
440 the second operand is named "\fB\&.\fR"
442 then the corresponding operand is assumed to be an offset operand rather than a
445 Without the \fB-N\fR count option, the display continues until an end-of-file
447 Only one of the first two conditions must be true.
453 \fB\fB[+] [0] \fR\fIoffset\fR \fB[.]\|[b|B]\fR\fR
457 \fB\fB+ [\fR\fIoffset\fR] \fB[.]\fR\fR
461 \fB\fB[+][0x]\fR[\fIoffset\fR]\fR
465 \fB\fB[+][0x]\fR \fIoffset\fR\fB\|[B]\fR\fR
469 \fB\fB+x [\fR\fIoffset\fR\fB]\fR\fR
473 \fB\fB+x\fR\fIoffset \fR\fB[B]\fR\fR
477 The \fIoffset_string\fR operand specifies the byte offset in the file where
478 dumping is to commence. The offset is interpreted in octal bytes by default.
479 If \fIoffset\fR begins with "\fB0\fR", it is interpreted in octal. If
480 \fIoffset\fR begins with "\fBx\fR" or "\fB0x\fR", it is interpreted in
481 hexadecimal and any appended "\fBb\fR" is considered to be the final
482 hexadecimal digit. If "." is appended, the offset is interpreted in decimal. If
483 "\fBb\fR" or "\fBB\fR" is appended, the offset is interpreted in units of
484 \fB512\fR bytes. If the \fBfile\fR argument is omitted, the \fIoffset\fR
485 argument must be preceded by a plus sign (\fB+\fR). The address is displayed
486 starting at the given offset. The radix of the address will be the same as the
487 radix of the offset, if specified, otherwise it will be octal. Decimal
488 overrides octal, and it is an error to specify both hexadecimal and decimal
489 conversions in the same offset operand.
492 .SH ENVIRONMENT VARIABLES
495 See \fBenviron\fR(5) for descriptions of the following environment variables
496 that affect the execution of \fBod\fR: \fBLANG\fR, \fBLC_ALL\fR,
497 \fBLC_CTYPE\fR, \fBLC_MESSAGES\fR, \fBLC_NUMERIC\fR, and \fBNLSPATH\fR.
501 The following exit values are returned:
508 Successful completion.
523 See \fBattributes\fR(5) for descriptions of the following attributes:
532 ATTRIBUTE TYPE ATTRIBUTE VALUE
536 Interface Stability Standard
542 \fBsed\fR(1), \fBattributes\fR(5), \fBenviron\fR(5), \fBstandards\fR(5)