manpages: Uniformly order the prologue macros by Dd/Dt/Os.
[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 .\"
35 .Dd April 17, 2002
36 .Dt OD 1
37 .Os
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 .It Xo
183 .Sm off
184 .Op Cm d | o | u | x
185 .Op Cm C | S | I | L | Ar n
186 .Sm on
187 .Xc
188 Signed decimal
189 .Pq Cm d ,
190 octal
191 .Pq Cm o ,
192 unsigned decimal
193 .Pq Cm u
194 or
195 hexadecimal
196 .Pq Cm x .
197 Followed by an optional size specifier, which may be either
198 .Cm C
199 .Pq Vt char ,
200 .Cm S
201 .Pq Vt short ,
202 .Cm I
203 .Pq Vt int ,
204 .Cm L
205 .Pq Vt long ,
206 or a byte count as a decimal integer.
207 .It Xo
208 .Sm off
209 .Cm f
210 .Op Cm F | D | L | Ar n
211 .Sm on
212 .Xc
213 Floating-point number.
214 Followed by an optional size specifier, which may be either
215 .Cm F
216 .Pq Vt float ,
217 .Cm D
218 .Pq Vt double
219 or
220 .Cm L
221 .Pq Vt "long double" .
222 .El
223 .It Fl v
224 Write all input data, instead of replacing lines of duplicate values with a
225 .Ql * .
226 .El
227 .Pp
228 Multiple options that specify output format may be used; the output will
229 contain one line for each format.
230 .Pp
231 If no output format is specified,
232 .Fl t Ar oS
233 is assumed.
234 .Sh EXIT STATUS
235 .Ex -std
236 .Sh COMPATIBILITY
237 The traditional
238 .Fl s
239 option to extract string constants is not supported; consider using
240 .Xr strings 1
241 instead.
242 .Sh SEE ALSO
243 .Xr hexdump 1 ,
244 .Xr strings 1
245 .Sh STANDARDS
246 The
247 .Nm
248 utility conforms to
249 .St -p1003.1-2001 .
250 .Sh HISTORY
251 An
252 .Nm
253 command appeared in
254 .At v1 .