]> CyberLeo.Net >> Repos - FreeBSD/releng/8.1.git/blob - usr.bin/hexdump/od.1
Copy stable/8 to releng/8.1 in preparation for 8.1-RC1.
[FreeBSD/releng/8.1.git] / usr.bin / 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$
34 .\"
35 .Dd February 18, 2010
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 .Op Oo Cm + Oc Ns Ar offset Ns Oo Cm \&. Oc Ns Op Cm Bb
49 .Op Ar
50 .Sh DESCRIPTION
51 The
52 .Nm
53 utility is a filter which displays the specified files, or standard
54 input if no files are specified, in a user specified format.
55 .Pp
56 The options are as follows:
57 .Bl -tag -width ".Fl I , L , l"
58 .It Fl A Ar base
59 Specify the input address base.
60 The argument
61 .Ar base
62 may be one of
63 .Cm d ,
64 .Cm o ,
65 .Cm x
66 or
67 .Cm n ,
68 which specify decimal, octal, hexadecimal
69 addresses or no address, respectively.
70 .It Fl a
71 Output named characters.
72 Equivalent to
73 .Fl t Cm a .
74 .It Fl B , o
75 Output octal shorts.
76 Equivalent to
77 .Fl t Cm o2 .
78 .It Fl b
79 Output octal bytes.
80 Equivalent to
81 .Fl t Cm o1 .
82 .It Fl c
83 Output C-style escaped characters.
84 Equivalent to
85 .Fl t Cm c .
86 .It Fl D
87 Output unsigned decimal ints.
88 Equivalent to
89 .Fl t Cm u4 .
90 .It Fl d
91 Output unsigned decimal shorts.
92 Equivalent to
93 .Fl t Cm u2 .
94 .It Fl e , F
95 Output double-precision floating point numbers.
96 Equivalent to
97 .Fl t Cm fD .
98 .It Fl f
99 Output single-precision floating point numbers.
100 Equivalent to
101 .Fl t Cm fF .
102 .It Fl H , X
103 Output hexadecimal ints.
104 Equivalent to
105 .Fl t Cm x4 .
106 .It Fl h , x
107 Output hexadecimal shorts.
108 Equivalent to
109 .Fl t Cm x2 .
110 .It Fl I , L , l
111 Output signed decimal longs.
112 Equivalent to
113 .Fl t Cm dL .
114 .It Fl i
115 Output signed decimal ints.
116 Equivalent to
117 .Fl t Cm dI .
118 .It Fl j Ar skip
119 Skip
120 .Ar skip
121 bytes of the combined input before dumping.
122 The number may be followed by one
123 of
124 .Cm b , k
125 or
126 .Cm m
127 which specify the units of the number as blocks (512 bytes), kilobytes and
128 megabytes, respectively.
129 .It Fl N Ar length
130 Dump at most
131 .Ar length
132 bytes of input.
133 .It Fl O
134 Output octal ints.
135 Equivalent to
136 .Fl t Cm o4 .
137 .It Fl s
138 Output signed decimal shorts.
139 Equivalent to
140 .Fl t Cm d2 .
141 .It Fl t Ar type
142 Specify the output format.
143 The
144 .Ar type
145 argument
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  07f 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.
185 The remaining bytes are shown as
186 .Ql ** .
187 .It Xo
188 .Sm off
189 .Op Cm d | o | u | x
190 .Op Cm C | S | I | L | Ar n
191 .Sm on
192 .Xc
193 Signed decimal
194 .Pq Cm d ,
195 octal
196 .Pq Cm o ,
197 unsigned decimal
198 .Pq Cm u
199 or
200 hexadecimal
201 .Pq Cm x .
202 Followed by an optional size specifier, which may be either
203 .Cm C
204 .Pq Vt char ,
205 .Cm S
206 .Pq Vt short ,
207 .Cm I
208 .Pq Vt int ,
209 .Cm L
210 .Pq Vt long ,
211 or a byte count as a decimal integer.
212 .It Xo
213 .Sm off
214 .Cm f
215 .Op Cm F | D | L | Ar n
216 .Sm on
217 .Xc
218 Floating-point number.
219 Followed by an optional size specifier, which may be either
220 .Cm F
221 .Pq Vt float ,
222 .Cm D
223 .Pq Vt double
224 or
225 .Cm L
226 .Pq Vt "long double" .
227 .El
228 .It Fl v
229 Write all input data, instead of replacing lines of duplicate values with a
230 .Ql * .
231 .El
232 .Pp
233 Multiple options that specify output format may be used; the output will
234 contain one line for each format.
235 .Pp
236 If no output format is specified,
237 .Fl t Cm oS
238 is assumed.
239 .Sh ENVIRONMENT
240 The
241 .Ev LANG , LC_ALL
242 and
243 .Ev LC_CTYPE
244 environment variables affect the execution of
245 .Nm
246 as described in
247 .Xr environ 7 .
248 .Sh EXIT STATUS
249 .Ex -std
250 .Sh COMPATIBILITY
251 The traditional
252 .Fl s
253 option to extract string constants is not supported; consider using
254 .Xr strings 1
255 instead.
256 .Sh SEE ALSO
257 .Xr hexdump 1 ,
258 .Xr strings 1
259 .Sh STANDARDS
260 The
261 .Nm
262 utility conforms to
263 .St -p1003.1-2001 .
264 .Sh HISTORY
265 An
266 .Nm
267 command appeared in
268 .At v1 .