Add the DragonFly cvs id and perform general cleanups on cvs/rcs/sccs ids. Most
[dragonfly.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: src/usr.bin/hexdump/od.1,v 1.8.2.5 2003/02/25 20:05:17 trhodes Exp $
34 .\" $DragonFly: src/usr.bin/hexdump/od.1,v 1.2 2003/06/17 04:29:27 dillon Exp $
35 .\"
36 .Dd April 17, 2002
37 .Os
38 .Dt OD 1
39 .Sh NAME
40 .Nm od
41 .Nd octal, decimal, hex, ASCII dump
42 .Sh SYNOPSIS
43 .Nm
44 .Op Fl aBbcDdeFfHhIiLlOosvXx
45 .Op Fl A Ar base
46 .Op Fl j Ar skip
47 .Op Fl N Ar length
48 .Op Fl t Ar type
49 .Sm off
50 .Oo
51 .Op Cm \&+
52 .Li offset
53 .Op Cm \&.
54 .Op Cm Bb
55 .Oc
56 .Sm on
57 .Op Ar
58 .Sh DESCRIPTION
59 The
60 .Nm
61 utility is a filter which displays the specified files, or standard
62 input if no files are specified, in a user specified format.
63 .Pp
64 The options are as follows:
65 .Bl -tag -width ".Fl I , L , l"
66 .It Fl A Ar base
67 Specify the input address base.
68 .Ar base
69 may be one of
70 .Cm d ,
71 .Cm o ,
72 .Cm x
73 or
74 .Cm n ,
75 which specify decimal, octal, hexadecimal
76 addresses or no address, respectively.
77 .It Fl a
78 Output named characters.
79 Equivalent to
80 .Fl t Ar a .
81 .It Fl B , o
82 Output octal shorts.
83 Equivalent to
84 .Fl t Ar o2 .
85 .It Fl b
86 Output octal bytes.
87 Equivalent to
88 .Fl t Ar o1 .
89 .It Fl c
90 Output C-style escaped characters.
91 Equivalent to
92 .Fl t Ar c .
93 .It Fl D
94 Output unsigned decimal ints.
95 Equivalent to
96 .Fl t Ar u4 .
97 .It Fl e , F
98 Output double-precision floating point numbers.
99 Equivalent to
100 .Fl t Ar fD .
101 .It Fl f
102 Output single-precision floating point numbers.
103 Equivalent to
104 .Fl t Ar fF .
105 .It Fl H , X
106 Output hexadecimal ints.
107 Equivalent to
108 .Fl t Ar x4 .
109 .It Fl h , x
110 Output hexadecimal shorts.
111 Equivalent to
112 .Fl t Ar x2 .
113 .It Fl I , L , l
114 Output signed decimal longs.
115 Equivalent to
116 .Fl t Ar dL .
117 .It Fl i
118 Output signed decimal ints.
119 Equivalent to
120 .Fl t Ar dI .
121 .It Fl j Ar skip
122 Skip
123 .Ar skip
124 bytes of the combined input before dumping.
125 The number may be followed by one
126 of
127 .Cm b , k
128 or
129 .Cm m
130 which specify the units of the number as blocks (512 bytes), kilobytes and
131 megabytes, respectively.
132 .It Fl N Ar length
133 Dump at most
134 .Ar length
135 bytes of input.
136 .It Fl O
137 Output octal ints.
138 Equivalent to
139 .Fl t Ar o4 .
140 .It Fl s
141 Output signed decimal shorts.
142 Equivalent to
143 .Fl t Ar d2 .
144 .It Fl t Ar type
145 Specify the output format.
146 .Ar type
147 is a string containing one or more of the following kinds of type specifiers:
148 .Bl -tag -width indent
149 .It Cm a
150 Named characters
151 .Pq Tn ASCII .
152 Control characters are displayed using the following names:
153 .Bl -column "000 NUL" "001 SOH" "002 STX" "003 ETX" "004 EOT" "005 ENQ"
154 .It "000 NUL    001 SOH 002 STX 003 ETX 004 EOT 005 ENQ"
155 .It "006 ACK    007 BEL 008 BS  009 HT  00a NL  00b VT"
156 .It "00c FF     00d CR  00e SO  00f SI  010 DLE 011 DC1"
157 .It "012 DC2    013 DC3 014 DC4 015 NAK 016 SYN 017 ETB"
158 .It "018 CAN    019 EM  01a SUB 01b ESC 01c FS  01d GS"
159 .It "01e RS     01f US  020 SP  0ff DEL"
160 .El
161 .It Cm c
162 Characters in the default character set.
163 Non-printing characters are
164 represented as 3-digit octal character codes, except the following
165 characters, which are represented as C escapes:
166 .Pp
167 .Bl -tag -width carriage-return -compact
168 .It NUL
169 \e0
170 .It alert
171 \ea
172 .It backspace
173 \eb
174 .It newline
175 \en
176 .It carriage-return
177 \er
178 .It tab
179 \et
180 .It vertical tab
181 \ev
182 .El
183 .It Xo
184 .Sm off
185 .Op Cm d | o | u | x
186 .Op Cm C | S | I | L | Ar n
187 .Sm on
188 .Xc
189 Signed decimal
190 .Pq Cm d ,
191 octal
192 .Pq Cm o ,
193 unsigned decimal
194 .Pq Cm u
195 or
196 hexadecimal
197 .Pq Cm x .
198 Followed by an optional size specifier, which may be either
199 .Cm C
200 .Pq Vt char ,
201 .Cm S
202 .Pq Vt short ,
203 .Cm I
204 .Pq Vt int ,
205 .Cm L
206 .Pq Vt long ,
207 or a byte count as a decimal integer.
208 .It Xo
209 .Sm off
210 .Cm f
211 .Op Cm F | D | L | Ar n
212 .Sm on
213 .Xc
214 Floating-point number.
215 Followed by an optional size specifier, which may be either
216 .Cm F
217 .Pq Vt float ,
218 .Cm D
219 .Pq Vt double
220 or
221 .Cm L
222 .Pq Vt "long double" .
223 .El
224 .It Fl v
225 Write all input data, instead of replacing lines of duplicate values with a
226 .Ql * .
227 .El
228 .Pp
229 Multiple options that specify output format may be used; the output will
230 contain one line for each format.
231 .Pp
232 If no output format is specified,
233 .Fl t Ar oS
234 is assumed.
235 .Sh DIAGNOSTICS
236 .Ex -std
237 .Sh COMPATIBILITY
238 The traditional
239 .Fl s
240 option to extract string constants is not supported; consider using
241 .Xr strings 1
242 instead.
243 .Sh SEE ALSO
244 .Xr hexdump 1 ,
245 .Xr strings 1
246 .Sh STANDARDS
247 The
248 .Nm
249 utility conforms to
250 .St -p1003.1-2001 .
251 .Sh HISTORY
252 An
253 .Nm
254 command appeared in
255 .At v1 .