]> git.saurik.com Git - apple/shell_cmds.git/blob - hexdump/od.1
shell_cmds-198.tar.gz
[apple/shell_cmds.git] / hexdump / od.1
1 .\" Copyright (c) 1990, 1993
2 .\" The Regents of the University of California. All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\" notice, this list of conditions and the following disclaimer in the
11 .\" documentation and/or other materials provided with the distribution.
12 .\" 3. All advertising materials mentioning features or use of this software
13 .\" must display the following acknowledgement:
14 .\" This product includes software developed by the University of
15 .\" California, Berkeley and its contributors.
16 .\" 4. Neither the name of the University nor the names of its contributors
17 .\" may be used to endorse or promote products derived from this software
18 .\" without specific prior written permission.
19 .\"
20 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" SUCH DAMAGE.
31 .\"
32 .\" @(#)od.1 8.1 (Berkeley) 6/6/93
33 .\" $FreeBSD: src/usr.bin/hexdump/od.1,v 1.17 2004/07/11 01:11:12 tjr Exp $
34 .\"
35 .Dd July 11, 2004
36 .Os
37 .Dt OD 1
38 .Sh NAME
39 .Nm od
40 .Nd octal, decimal, hex, ASCII dump
41 .Sh SYNOPSIS
42 .Nm
43 .Op Fl aBbcDdeFfHhIiLlOosvXx
44 .Op Fl A Ar base
45 .Op Fl j Ar skip
46 .Op Fl N Ar length
47 .Op Fl t Ar type
48 .Sm off
49 .Oo
50 .Op Cm \&+
51 .Li offset
52 .Op Cm \&.
53 .Op Cm Bb
54 .Oc
55 .Sm on
56 .Op Ar
57 .Sh DESCRIPTION
58 The
59 .Nm
60 utility is a filter which displays the specified files, or standard
61 input if no files are specified, in a user specified format.
62 .Pp
63 The options are as follows:
64 .Bl -tag -width ".Fl I , L , l"
65 .It Fl A Ar base
66 Specify the input address base.
67 .Ar base
68 may be one of
69 .Cm d ,
70 .Cm o ,
71 .Cm x
72 or
73 .Cm n ,
74 which specify decimal, octal, hexadecimal
75 addresses or no address, respectively.
76 .It Fl a
77 Output named characters.
78 Equivalent to
79 .Fl t Ar a .
80 .It Fl B , o
81 Output octal shorts.
82 Equivalent to
83 .Fl t Ar o2 .
84 .It Fl b
85 Output octal bytes.
86 Equivalent to
87 .Fl t Ar o1 .
88 .It Fl c
89 Output C-style escaped characters.
90 Equivalent to
91 .Fl t Ar c .
92 .It Fl D
93 Output unsigned decimal ints.
94 Equivalent to
95 .Fl t Ar u4 .
96 .It Fl e , F
97 Output double-precision floating point numbers.
98 Equivalent to
99 .Fl t Ar fD .
100 .It Fl f
101 Output single-precision floating point numbers.
102 Equivalent to
103 .Fl t Ar fF .
104 .It Fl H , X
105 Output hexadecimal ints.
106 Equivalent to
107 .Fl t Ar x4 .
108 .It Fl h , x
109 Output hexadecimal shorts.
110 Equivalent to
111 .Fl t Ar x2 .
112 .It Fl I , L , l
113 Output signed decimal longs.
114 Equivalent to
115 .Fl t Ar dL .
116 .It Fl i
117 Output signed decimal ints.
118 Equivalent to
119 .Fl t Ar dI .
120 .It Fl j Ar skip
121 Skip
122 .Ar skip
123 bytes of the combined input before dumping.
124 The number may be followed by one
125 of
126 .Cm b , k
127 or
128 .Cm m
129 which specify the units of the number as blocks (512 bytes), kilobytes and
130 megabytes, respectively.
131 .It Fl N Ar length
132 Dump at most
133 .Ar length
134 bytes of input.
135 .It Fl O
136 Output octal ints.
137 Equivalent to
138 .Fl t Ar o4 .
139 .It Fl s
140 Output signed decimal shorts.
141 Equivalent to
142 .Fl t Ar d2 .
143 .It Fl t Ar type
144 Specify the output format.
145 .Ar type
146 is a string containing one or more of the following kinds of type specifiers:
147 .Bl -tag -width indent
148 .It Cm a
149 Named characters
150 .Pq Tn ASCII .
151 Control characters are displayed using the following names:
152 .Bl -column "000 NUL" "001 SOH" "002 STX" "003 ETX" "004 EOT" "005 ENQ"
153 .It "000 NUL 001 SOH 002 STX 003 ETX 004 EOT 005 ENQ"
154 .It "006 ACK 007 BEL 008 BS 009 HT 00a NL 00b VT"
155 .It "00c FF 00d CR 00e SO 00f SI 010 DLE 011 DC1"
156 .It "012 DC2 013 DC3 014 DC4 015 NAK 016 SYN 017 ETB"
157 .It "018 CAN 019 EM 01a SUB 01b ESC 01c FS 01d GS"
158 .It "01e RS 01f US 020 SP 0ff DEL"
159 .El
160 .It Cm c
161 Characters in the default character set.
162 Non-printing characters are
163 represented as 3-digit octal character codes, except the following
164 characters, which are represented as C escapes:
165 .Pp
166 .Bl -tag -width carriage-return -compact
167 .It NUL
168 \e0
169 .It alert
170 \ea
171 .It backspace
172 \eb
173 .It newline
174 \en
175 .It carriage-return
176 \er
177 .It tab
178 \et
179 .It vertical tab
180 \ev
181 .El
182 .Pp
183 Multi-byte characters are displayed in the area corresponding to the first
184 byte of the character. The remaining bytes are shown as
185 .Ql ** .
186 .It Xo
187 .Sm off
188 .Op Cm d | o | u | x
189 .Op Cm C | S | I | L | Ar n
190 .Sm on
191 .Xc
192 Signed decimal
193 .Pq Cm d ,
194 octal
195 .Pq Cm o ,
196 unsigned decimal
197 .Pq Cm u
198 or
199 hexadecimal
200 .Pq Cm x .
201 Followed by an optional size specifier, which may be either
202 .Cm C
203 .Pq Vt char ,
204 .Cm S
205 .Pq Vt short ,
206 .Cm I
207 .Pq Vt int ,
208 .Cm L
209 .Pq Vt long ,
210 or a byte count as a decimal integer.
211 .It Xo
212 .Sm off
213 .Cm f
214 .Op Cm F | D | L | Ar n
215 .Sm on
216 .Xc
217 Floating-point number.
218 Followed by an optional size specifier, which may be either
219 .Cm F
220 .Pq Vt float ,
221 .Cm D
222 .Pq Vt double
223 or
224 .Cm L
225 .Pq Vt "long double" .
226 .El
227 .It Fl v
228 Write all input data, instead of replacing lines of duplicate values with a
229 .Ql * .
230 .El
231 .Pp
232 Multiple options that specify output format may be used; the output will
233 contain one line for each format.
234 .Pp
235 If no output format is specified,
236 .Fl t Ar oS
237 is assumed.
238 .Sh ENVIRONMENT
239 The
240 .Ev LANG , LC_ALL
241 and
242 .Ev LC_CTYPE
243 environment variables affect the execution of
244 .Nm
245 as described in
246 .Xr environ 7 .
247 .Sh DIAGNOSTICS
248 .Ex -std
249 .Sh COMPATIBILITY
250 The traditional
251 .Fl s
252 option to extract string constants is not supported; consider using
253 .Xr strings 1
254 instead.
255 .Sh SEE ALSO
256 .Xr hexdump 1 ,
257 .Xr strings 1
258 .Sh STANDARDS
259 The
260 .Nm
261 utility conforms to
262 .St -p1003.1-2001 .
263 .Sh HISTORY
264 An
265 .Nm
266 command appeared in
267 .At v1 .