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 "May 20, 2005"
53 \fB/usr/bin/od\fR [\fB-bcCDdFfOoSsvXx\fR] [\fB-\fR] [\fIfile\fR] [\fIoffset_string\fR]
58 \fB/usr/bin/od\fR [\fB-bcCDdFfOoSsvXx\fR] [\fB-A\fR \fIaddress_base\fR] [\fB-j\fR \fIskip\fR]
59 [\fB-N\fR \fIcount\fR] [\fB-t\fR \fItype_string\fR]... [\fB-\fR] [\fIfile\fR]...
64 \fB/usr/xpg4/bin/od\fR [\fB-bcCDdFfOoSsvXx\fR] [\fIfile\fR] [\fIoffset_string\fR]
69 \fB/usr/xpg4/bin/od\fR [\fB-bcCDdFfOoSsvXx\fR] [\fB-A\fR \fIaddress_base\fR]
70 [\fB-j\fR \fIskip\fR] [\fB-N\fR \fIcount\fR] [\fB-t\fR \fItype_string\fR]... [\fIfile\fR]...
76 The \fBod\fR command copies sequentially each input file to standard output and
77 transforms the input data according to the output types specified by the
78 \fB-t\fR or \fB-bcCDdFfOoSsvXx\fR options. If no output type is specified, the
79 default output is as if \fB-t\fR \fBo2\fR had been specified. Multiple types
80 can be specified by using multiple \fB-bcCDdFfOoSstvXx\fR options. Output lines
81 are written for each type specified in the order in which the types are
82 specified. If no \fIfile\fR is specified, the standard input is used. The
83 [\fIoffset_string\fR] operand is mutually exclusive from the \fB-A\fR,
84 \fB-j\fR, \fB-N\fR, and \fB-t\fR options. For the purposes of this description,
85 the following terms are used:
92 Refers to a 16-bit unit, independent of the word size of the machine.
101 Refers to a 32-bit unit.
107 \fBdouble long word\fR
110 Refers to a 64-bit unit.
116 The following options are supported:
120 \fB\fB-A\fR \fIaddress_base\fR \fR
123 Specifies the input offset base. The \fIaddress_base\fR option-argument must be
124 a character. The characters \fBd\fR, \fBo\fR and \fBx\fR specify that the
125 offset base will be written in decimal, octal or hexadecimal, respectively. The
126 character \fBn\fR specifies that the offset will not be written. Unless
127 \fB-A\fR \fBn\fR is specified, the output line will be preceded by the input
128 offset, cumulative across input files, of the next byte to be written. In
129 addition, the offset of the byte following the last byte written will be
130 displayed after all the input data has been processed. Without the \fB-A\fR
131 \fIaddress_base\fR option and the [\fIoffset_string\fR] operand, the input
132 offset base is displayed in octal.
141 Interprets bytes in octal. This is equivalent to \fB-t\fR \fBo1\fR.
151 Displays single-byte characters. Certain non-graphic characters appear as
166 Others appear as 3-digit octal numbers. For example:
170 \fBecho "hello world" | od \(mic\fR
171 0000000 h e l l o w o r l d \en
179 .SS "/usr/xpg4/bin/od"
186 Interprets bytes as single-byte or multibyte characters according to the
187 current setting of the \fBLC_CTYPE\fR locale category. Printable multibyte
188 characters are written in the area corresponding to the first byte of the
189 character. The two-character sequence \fB**\fR is written in the area
190 corresponding to each remaining byte in the character, as an indication that
191 the character is continued. Non-graphic characters appear the same as they
192 would using the \fB-C\fR option.
201 Interprets bytes as single-byte or multibyte characters according to the
202 current setting of the \fBLC_CTYPE\fR locale category. Printable multibyte
203 characters are written in the area corresponding to the first byte of the
204 character. The two-character sequence ** is written in the area corresponding
205 to each remaining byte in the character, as an indication that the character is
206 continued. Certain non-graphic characters appear as C escapes:
220 Other non-printable characters appear as one three-digit octal number for each
221 byte in the character.
230 Interprets words in unsigned decimal. This is equivalent to \fB-t\fR \fBu2\fR.
239 Interprets long words in unsigned decimal. This is equivalent to \fB-t\fR
249 Interprets long words in floating point. This is equivalent to \fB-t\fR
259 Interprets double long words in extended precision. This is equivalent to
266 \fB\fB-j\fR \fIskip\fR \fR
269 Jumps over \fIskip\fR bytes from the beginning of the input. The \fBod\fR
270 command will read or seek past the first \fIskip\fR bytes in the concatenated
271 input files. If the combined input is not at least \fIskip\fR bytes long, the
272 \fBod\fR command will write a diagnostic message to standard error and exit
273 with a non-zero exit status.
275 By default, the \fIskip\fR option-argument is interpreted as a decimal number.
276 With a leading \fB0x\fR or \fB0X\fR, the offset is interpreted as a hexadecimal
277 number; otherwise, with a leading \fB0\fR, the offset will be interpreted as an
278 octal number. Appending the character \fBb\fR, \fBk\fR, or \fBm\fR to offset
279 will cause it to be interpreted as a multiple of \fB512\fR, \fB1024\fR or
280 \fB1\|048\|576\fR bytes, respectively. If the \fIskip\fR number is hexadecimal,
281 any appended \fBb\fR is considered to be the final hexadecimal digit. The
282 address is displayed starting at \fB0000000\fR, and its base is not implied by
283 the base of the \fIskip\fR option-argument.
289 \fB\fB-N\fR \fIcount\fR \fR
292 Formats no more than \fIcount\fR bytes of input. By default, \fIcount\fR is
293 interpreted as a decimal number. With a leading \fB0x\fR or \fB0X\fR,
294 \fIcount\fR is interpreted as a hexadecimal number; otherwise, with a leading
295 \fB0\fR, it is interpreted as an octal number. If \fIcount\fR bytes of input
296 (after successfully skipping, if \fB-j\fR\fIskip\fR is specified) are not
297 available, it will not be considered an error. The \fBod\fR command will format
298 the input that is available. The base of the address displayed is not implied
299 by the base of the \fIcount\fR option-argument.
308 Interprets words in octal. This is equivalent to \fB-t\fR \fBo2\fR.
317 Interprets long words in unsigned octal. This is equivalent to \fB-t\fR
327 Interprets words in signed decimal. This is equivalent to \fB-t\fR \fBd2\fR.
336 Interprets long words in signed decimal. This is equivalent to \fB-t\fR
343 \fB\fB-t\fR \fItype_string\fR \fR
346 Specifies one or more output types. The \fItype_string\fR option-argument must
347 be a string specifying the types to be used when writing the input data. The
348 string must consist of the type specification characters:
355 \fINamed character\fR. Interprets bytes as named characters. Only the least
356 significant seven bits of each byte will be used for this type specification.
357 Bytes with the values listed in the following table will be written using the
358 corresponding names for those characters.
360 The following are named characters in \fBod\fR:
412 \fICharacter\fR. Interprets bytes as single-byte or multibyte characters
413 specified by the current setting of the \fBLC_CTYPE\fR locale category.
414 Printable multibyte characters are written in the area corresponding to the
415 first byte of the character. The two-character sequence \fB**\fR is written in
416 the area corresponding to each remaining byte in the character, as an
417 indication that the character is continued. Certain non-graphic characters
418 appear as C escapes: \fB\e0\fR, \fB\ea\fR, \fB\eb\fR, \fB\ef\fR, \fB\en\fR,
419 \fB\er\fR, \fB\et\fR, \fB\ev\fR\&. Other non-printable characters appear as one
420 three-digit octal number for each byte in the character.
423 The type specification characters \fBd\fR, \fBf\fR, \fBo\fR, \fBu\fR, and
424 \fBx\fR can be followed by an optional unsigned decimal integer that specifies
425 the number of bytes to be transformed by each instance of the output type.
432 \fIFloating point\fR. Can be followed by an optional \fBF\fR, \fBD\fR, or
433 \fBL\fR indicating that the conversion should be applied to an item of type
434 \fBfloat\fR, \fBdouble\fR, or \fBlong double\fR, respectively.
440 \fB\fBd\fR, \fBo\fR, \fBu\fR, and \fBx\fR\fR
443 \fISigned decimal\fR, \fIoctal\fR, \fIunsigned decimal\fR, and
444 \fIhexadecimal\fR, respectively. Can be followed by an optional \fBC\fR,
445 \fBS\fR, \fBI\fR, or \fBL\fR indicating that the conversion should be applied
446 to an item of type \fBchar\fR, \fBshort\fR, \fBint\fR, or \fBlong\fR,
450 Multiple types can be concatenated within the same \fItype_string\fR and
451 multiple \fB-t\fR options can be specified. Output lines are written for each
452 type specified in the order in which the type specification characters are
462 Shows all input data (verbose). Without the \fB-v\fR option, all groups of
463 output lines that would be identical to the immediately preceding output line
464 (except for byte offsets), will be replaced with a line containing only an
474 Interprets words in hex. This is equivalent to \fB-t\fR \fBx2\fR.
483 Interprets long words in hex. This is equivalent to \fB-t\fR \fBx4\fR.
490 The following operands are supported for \fB/usr/bin/od\fR only:
497 Uses the standard input in addition to any files specified. When this operand
498 is not given, the standard input is used only if no \fIfile\fR operands are
508 A path name of a file to be read. If no \fIfile\fR operands are specified, the
509 standard input will be used. If there are no more than two operands, none of
510 the \fB-A\fR, \fB-j\fR, \fB-N\fR, or \fB-t\fR options is specified, and
511 \fIany\fR of the following are true:
515 the first character of the last operand is a plus sign (+)
520 the first character of the second operand is numeric
525 the first character of the second operand is \fBx\fR and the second
526 character of the second operand is a lower-case hexadecimal character or digit
531 the second operand is named "\fBx\fR"
536 the second operand is named "\fB\&.\fR"
538 then the corresponding operand is assumed to be an offset operand rather than a
541 Without the \fB-N\fR count option, the display continues until an end-of-file
548 \fB\fB[+][0]\fR \fIoffset\fR \fB[.][b|B]\fR\fR
552 \fB\fB[+][0][\fR\fIoffset\fR] \fB[.]\fR\fR
556 \fB\fB[+][0x|x]\fR[\fIoffset\fR]\fR
560 \fB\fB[+][0x|x]\fR \fIoffset\fR\fB[B]\fR\fR
563 The \fIoffset_string\fR operand specifies the byte offset in the file where
564 dumping is to commence. The offset is interpreted in octal bytes by default.
565 If \fIoffset\fR begins with "\fB0\fR", it is interpreted in octal. If
566 \fIoffset\fR begins with "\fBx\fR" or "\fB0x\fR", it is interpreted in
567 hexadecimal and any appended "\fBb\fR" is considered to be the final
568 hexadecimal digit. If "." is appended, the offset is interpreted in decimal. If
569 "\fBb\fR" or "\fBB\fR" is appended, the offset is interpreted in units of
570 \fB512\fR bytes. If the \fBfile\fR argument is omitted, the \fIoffset\fR
571 argument must be preceded by a plus sign (\fB+\fR). The address is displayed
572 starting at the given offset. The radix of the address will be the same as the
573 radix of the offset, if specified, otherwise it will be octal. Decimal
574 overrides octal, and it is an error to specify both hexadecimal and decimal
575 conversions in the same offset operand.
578 .SS "/usr/xpg4/bin/od"
581 The following operands are supported for \fB/usr/xpg4/bin/od\fR only:
588 Same as \fB/usr/bin/od\fR, except only one of the first two conditions must be
595 \fB\fB[+] [0] \fR\fIoffset\fR \fB[.]\|[b|B]\fR\fR
599 \fB\fB+ [\fR\fIoffset\fR] \fB[.]\fR\fR
603 \fB\fB[+][0x]\fR[\fIoffset\fR]\fR
607 \fB\fB[+][0x]\fR \fIoffset\fR\fB\|[B]\fR\fR
611 \fB\fB+x [\fR\fIoffset\fR\fB]\fR\fR
615 \fB\fB+x\fR\fIoffset \fR\fB[B]\fR\fR
618 Description of \fIoffset_string\fR is the same as for \fB/usr/bin/od\fR.
621 .SH ENVIRONMENT VARIABLES
624 See \fBenviron\fR(5) for descriptions of the following environment variables
625 that affect the execution of \fBod\fR: \fBLANG\fR, \fBLC_ALL\fR,
626 \fBLC_CTYPE\fR, \fBLC_MESSAGES\fR, \fBLC_NUMERIC\fR, and \fBNLSPATH\fR.
630 The following exit values are returned:
637 Successful completion.
652 See \fBattributes\fR(5) for descriptions of the following attributes:
661 ATTRIBUTE TYPE ATTRIBUTE VALUE
666 .SS "/usr/xpg4/bin/od"
674 ATTRIBUTE TYPE ATTRIBUTE VALUE
678 Interface Stability Standard
684 \fBsed\fR(1), \fBattributes\fR(5), \fBenviron\fR(5), \fBstandards\fR(5)