2 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for
3 .\" permission to reproduce portions of its copyrighted documentation.
4 .\" Original documentation from The Open Group can be obtained online at
5 .\" http://www.opengroup.org/bookstore/.
7 .\" The Institute of Electrical and Electronics Engineers and The Open
8 .\" Group, have given us permission to reprint portions of their
11 .\" In the following statement, the phrase ``this text'' refers to portions
12 .\" of the system documentation.
14 .\" Portions of this text are reprinted and reproduced in electronic form
15 .\" in the SunOS Reference Manual, from IEEE Std 1003.1, 2004 Edition,
16 .\" Standard for Information Technology -- Portable Operating System
17 .\" Interface (POSIX), The Open Group Base Specifications Issue 6,
18 .\" Copyright (C) 2001-2004 by the Institute of Electrical and Electronics
19 .\" Engineers, Inc and The Open Group. In the event of any discrepancy
20 .\" between these versions and the original IEEE and The Open Group
21 .\" Standard, the original IEEE and The Open Group Standard is the referee
22 .\" document. The original Standard can be obtained online at
23 .\" http://www.opengroup.org/unix/online.html.
25 .\" This notice shall appear on any product containing this material.
27 .\" The contents of this file are subject to the terms of the
28 .\" Common Development and Distribution License (the "License").
29 .\" You may not use this file except in compliance with the License.
31 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
32 .\" or http://www.opensolaris.org/os/licensing.
33 .\" See the License for the specific language governing permissions
34 .\" and limitations under the License.
36 .\" When distributing Covered Code, include this CDDL HEADER in each
37 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
38 .\" If applicable, add the following below this CDDL HEADER, with the
39 .\" fields enclosed by brackets "[]" replaced with your own identifying
40 .\" information: Portions Copyright [yyyy] [name of copyright owner]
43 .\" Copyright 1989 AT&T
44 .\" Copyright (c) 1992, X/Open Company Limited. All Rights Reserved.
45 .\" Portions Copyright (c) 2005, Sun Microsystems, Inc. All Rights Reserved.
47 .TH OD 1 "Oct 25, 2017"
53 \fB/usr/bin/od\fR [\fB-bcCDdFfOoSsvXx\fR] [\fIfile\fR] [\fIoffset_string\fR]
58 \fB/usr/bin/od\fR [\fB-bcCDdFfOoSsvXx\fR] [\fB-A\fR \fIaddress_base\fR]
59 [\fB-j\fR \fIskip\fR] [\fB-N\fR \fIcount\fR] [\fB-t\fR \fItype_string\fR]... [\fIfile\fR]...
65 The \fBod\fR command copies sequentially each input file to standard output and
66 transforms the input data according to the output types specified by the
67 \fB-t\fR or \fB-bcCDdFfOoSsvXx\fR options. If no output type is specified, the
68 default output is as if \fB-t\fR \fBo2\fR had been specified. Multiple types
69 can be specified by using multiple \fB-bcCDdFfOoSstvXx\fR options. Output lines
70 are written for each type specified in the order in which the types are
71 specified. If no \fIfile\fR is specified, the standard input is used. The
72 [\fIoffset_string\fR] operand is mutually exclusive from the \fB-A\fR,
73 \fB-j\fR, \fB-N\fR, and \fB-t\fR options. For the purposes of this description,
74 the following terms are used:
81 Refers to a 16-bit unit, independent of the word size of the machine.
90 Refers to a 32-bit unit.
96 \fBdouble long word\fR
99 Refers to a 64-bit unit.
105 The following options are supported:
109 \fB\fB-A\fR \fIaddress_base\fR \fR
112 Specifies the input offset base. The \fIaddress_base\fR option-argument must be
113 a character. The characters \fBd\fR, \fBo\fR and \fBx\fR specify that the
114 offset base will be written in decimal, octal or hexadecimal, respectively. The
115 character \fBn\fR specifies that the offset will not be written. Unless
116 \fB-A\fR \fBn\fR is specified, the output line will be preceded by the input
117 offset, cumulative across input files, of the next byte to be written. In
118 addition, the offset of the byte following the last byte written will be
119 displayed after all the input data has been processed. Without the \fB-A\fR
120 \fIaddress_base\fR option and the [\fIoffset_string\fR] operand, the input
121 offset base is displayed in octal.
130 Interprets bytes in octal. This is equivalent to \fB-t\fR \fBo1\fR.
139 Interprets bytes as single-byte or multibyte characters according to the
140 current setting of the \fBLC_CTYPE\fR locale category. Printable multibyte
141 characters are written in the area corresponding to the first byte of the
142 character. The two-character sequence \fB**\fR is written in the area
143 corresponding to each remaining byte in the character, as an indication that
144 the character is continued. Non-graphic characters appear the same as they
145 would using the \fB-C\fR option.
154 Interprets bytes as single-byte or multibyte characters according to the
155 current setting of the \fBLC_CTYPE\fR locale category. Printable multibyte
156 characters are written in the area corresponding to the first byte of the
157 character. The two-character sequence ** is written in the area corresponding
158 to each remaining byte in the character, as an indication that the character is
159 continued. Certain non-graphic characters appear as C escapes:
173 Other non-printable characters appear as one three-digit octal number for each
174 byte in the character.
183 Interprets words in unsigned decimal. This is equivalent to \fB-t\fR \fBu2\fR.
192 Interprets long words in unsigned decimal. This is equivalent to \fB-t\fR
202 Interprets long words in floating point. This is equivalent to \fB-t\fR
212 Interprets double long words in extended precision. This is equivalent to
219 \fB\fB-j\fR \fIskip\fR \fR
222 Jumps over \fIskip\fR bytes from the beginning of the input. The \fBod\fR
223 command will read or seek past the first \fIskip\fR bytes in the concatenated
224 input files. If the combined input is not at least \fIskip\fR bytes long, the
225 \fBod\fR command will write a diagnostic message to standard error and exit
226 with a non-zero exit status.
228 By default, the \fIskip\fR option-argument is interpreted as a decimal number.
229 With a leading \fB0x\fR or \fB0X\fR, the offset is interpreted as a hexadecimal
230 number; otherwise, with a leading \fB0\fR, the offset will be interpreted as an
231 octal number. Appending the character \fBb\fR, \fBk\fR, or \fBm\fR to offset
232 will cause it to be interpreted as a multiple of \fB512\fR, \fB1024\fR or
233 \fB1\|048\|576\fR bytes, respectively. If the \fIskip\fR number is hexadecimal,
234 any appended \fBb\fR is considered to be the final hexadecimal digit. The
235 address is displayed starting at \fB0000000\fR, and its base is not implied by
236 the base of the \fIskip\fR option-argument.
242 \fB\fB-N\fR \fIcount\fR \fR
245 Formats no more than \fIcount\fR bytes of input. By default, \fIcount\fR is
246 interpreted as a decimal number. With a leading \fB0x\fR or \fB0X\fR,
247 \fIcount\fR is interpreted as a hexadecimal number; otherwise, with a leading
248 \fB0\fR, it is interpreted as an octal number. If \fIcount\fR bytes of input
249 (after successfully skipping, if \fB-j\fR\fIskip\fR is specified) are not
250 available, it will not be considered an error. The \fBod\fR command will format
251 the input that is available. The base of the address displayed is not implied
252 by the base of the \fIcount\fR option-argument.
261 Interprets words in octal. This is equivalent to \fB-t\fR \fBo2\fR.
270 Interprets long words in unsigned octal. This is equivalent to \fB-t\fR
280 Interprets words in signed decimal. This is equivalent to \fB-t\fR \fBd2\fR.
289 Interprets long words in signed decimal. This is equivalent to \fB-t\fR
296 \fB\fB-t\fR \fItype_string\fR \fR
299 Specifies one or more output types. The \fItype_string\fR option-argument must
300 be a string specifying the types to be used when writing the input data. The
301 string must consist of the type specification characters:
308 \fINamed character\fR. Interprets bytes as named characters. Only the least
309 significant seven bits of each byte will be used for this type specification.
310 Bytes with the values listed in the following table will be written using the
311 corresponding names for those characters.
313 The following are named characters in \fBod\fR:
365 \fICharacter\fR. Interprets bytes as single-byte or multibyte characters
366 specified by the current setting of the \fBLC_CTYPE\fR locale category.
367 Printable multibyte characters are written in the area corresponding to the
368 first byte of the character. The two-character sequence \fB**\fR is written in
369 the area corresponding to each remaining byte in the character, as an
370 indication that the character is continued. Certain non-graphic characters
371 appear as C escapes: \fB\e0\fR, \fB\ea\fR, \fB\eb\fR, \fB\ef\fR, \fB\en\fR,
372 \fB\er\fR, \fB\et\fR, \fB\ev\fR\&. Other non-printable characters appear as one
373 three-digit octal number for each byte in the character.
376 The type specification characters \fBd\fR, \fBf\fR, \fBo\fR, \fBu\fR, and
377 \fBx\fR can be followed by an optional unsigned decimal integer that specifies
378 the number of bytes to be transformed by each instance of the output type.
385 \fIFloating point\fR. Can be followed by an optional \fBF\fR, \fBD\fR, or
386 \fBL\fR indicating that the conversion should be applied to an item of type
387 \fBfloat\fR, \fBdouble\fR, or \fBlong double\fR, respectively.
393 \fB\fBd\fR, \fBo\fR, \fBu\fR, and \fBx\fR\fR
396 \fISigned decimal\fR, \fIoctal\fR, \fIunsigned decimal\fR, and
397 \fIhexadecimal\fR, respectively. Can be followed by an optional \fBC\fR,
398 \fBS\fR, \fBI\fR, or \fBL\fR indicating that the conversion should be applied
399 to an item of type \fBchar\fR, \fBshort\fR, \fBint\fR, or \fBlong\fR,
403 Multiple types can be concatenated within the same \fItype_string\fR and
404 multiple \fB-t\fR options can be specified. Output lines are written for each
405 type specified in the order in which the type specification characters are
415 Shows all input data (verbose). Without the \fB-v\fR option, all groups of
416 output lines that would be identical to the immediately preceding output line
417 (except for byte offsets), will be replaced with a line containing only an
427 Interprets words in hex. This is equivalent to \fB-t\fR \fBx2\fR.
436 Interprets long words in hex. This is equivalent to \fB-t\fR \fBx4\fR.
442 The following operands are supported:
449 A path name of a file to be read. If no \fIfile\fR operands are specified, the
450 standard input will be used. If there are no more than two operands, none of
451 the \fB-A\fR, \fB-j\fR, \fB-N\fR, or \fB-t\fR options is specified, and
452 \fIany\fR of the following are true:
456 the first character of the last operand is a plus sign (+)
461 the first character of the second operand is numeric
466 the first character of the second operand is \fBx\fR and the second
467 character of the second operand is a lower-case hexadecimal character or digit
472 the second operand is named "\fBx\fR"
477 the second operand is named "\fB\&.\fR"
479 then the corresponding operand is assumed to be an offset operand rather than a
482 Without the \fB-N\fR count option, the display continues until an end-of-file
484 Only one of the first two conditions must be true.
490 \fB\fB[+] [0] \fR\fIoffset\fR \fB[.]\|[b|B]\fR\fR
494 \fB\fB+ [\fR\fIoffset\fR] \fB[.]\fR\fR
498 \fB\fB[+][0x]\fR[\fIoffset\fR]\fR
502 \fB\fB[+][0x]\fR \fIoffset\fR\fB\|[B]\fR\fR
506 \fB\fB+x [\fR\fIoffset\fR\fB]\fR\fR
510 \fB\fB+x\fR\fIoffset \fR\fB[B]\fR\fR
514 The \fIoffset_string\fR operand specifies the byte offset in the file where
515 dumping is to commence. The offset is interpreted in octal bytes by default.
516 If \fIoffset\fR begins with "\fB0\fR", it is interpreted in octal. If
517 \fIoffset\fR begins with "\fBx\fR" or "\fB0x\fR", it is interpreted in
518 hexadecimal and any appended "\fBb\fR" is considered to be the final
519 hexadecimal digit. If "." is appended, the offset is interpreted in decimal. If
520 "\fBb\fR" or "\fBB\fR" is appended, the offset is interpreted in units of
521 \fB512\fR bytes. If the \fBfile\fR argument is omitted, the \fIoffset\fR
522 argument must be preceded by a plus sign (\fB+\fR). The address is displayed
523 starting at the given offset. The radix of the address will be the same as the
524 radix of the offset, if specified, otherwise it will be octal. Decimal
525 overrides octal, and it is an error to specify both hexadecimal and decimal
526 conversions in the same offset operand.
529 .SH ENVIRONMENT VARIABLES
532 See \fBenviron\fR(5) for descriptions of the following environment variables
533 that affect the execution of \fBod\fR: \fBLANG\fR, \fBLC_ALL\fR,
534 \fBLC_CTYPE\fR, \fBLC_MESSAGES\fR, \fBLC_NUMERIC\fR, and \fBNLSPATH\fR.
538 The following exit values are returned:
545 Successful completion.
560 See \fBattributes\fR(5) for descriptions of the following attributes:
569 ATTRIBUTE TYPE ATTRIBUTE VALUE
573 Interface Stability Standard
579 \fBsed\fR(1), \fBattributes\fR(5), \fBenviron\fR(5), \fBstandards\fR(5)