hexdump(1): clean up tables in man pages, output is lower-case
[dragonfly.git] / usr.bin / hexdump / od.1
... / ...
CommitLineData
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. Neither the name of the University nor the names of its contributors
13.\" may be used to endorse or promote products derived from this software
14.\" without specific prior written permission.
15.\"
16.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26.\" SUCH DAMAGE.
27.\"
28.\" @(#)od.1 8.1 (Berkeley) 6/6/93
29.\" $FreeBSD: src/usr.bin/hexdump/od.1,v 1.8.2.5 2003/02/25 20:05:17 trhodes Exp $
30.\"
31.Dd April 17, 2002
32.Dt OD 1
33.Os
34.Sh NAME
35.Nm od
36.Nd octal, decimal, hex, ASCII dump
37.Sh SYNOPSIS
38.Nm
39.Op Fl aBbcDdeFfHhIiLlOosvXx
40.Op Fl A Ar base
41.Op Fl j Ar skip
42.Op Fl N Ar length
43.Op Fl t Ar type
44.Sm off
45.Oo
46.Op Cm \&+
47.Li offset
48.Op Cm \&.
49.Op Cm Bb
50.Oc
51.Sm on
52.Op Ar
53.Sh DESCRIPTION
54The
55.Nm
56utility is a filter which displays the specified files, or standard
57input if no files are specified, in a user specified format.
58.Pp
59The options are as follows:
60.Bl -tag -width ".Fl I , L , l"
61.It Fl A Ar base
62Specify the input address base.
63.Ar base
64may be one of
65.Cm d ,
66.Cm o ,
67.Cm x
68or
69.Cm n ,
70which specify decimal, octal, hexadecimal
71addresses or no address, respectively.
72.It Fl a
73Output named characters.
74Equivalent to
75.Fl t Ar a .
76.It Fl B , o
77Output octal shorts.
78Equivalent to
79.Fl t Ar o2 .
80.It Fl b
81Output octal bytes.
82Equivalent to
83.Fl t Ar o1 .
84.It Fl c
85Output C-style escaped characters.
86Equivalent to
87.Fl t Ar c .
88.It Fl D
89Output unsigned decimal ints.
90Equivalent to
91.Fl t Ar u4 .
92.It Fl e , F
93Output double-precision floating point numbers.
94Equivalent to
95.Fl t Ar fD .
96.It Fl f
97Output single-precision floating point numbers.
98Equivalent to
99.Fl t Ar fF .
100.It Fl H , X
101Output hexadecimal ints.
102Equivalent to
103.Fl t Ar x4 .
104.It Fl h , x
105Output hexadecimal shorts.
106Equivalent to
107.Fl t Ar x2 .
108.It Fl I , L , l
109Output signed decimal longs.
110Equivalent to
111.Fl t Ar dL .
112.It Fl i
113Output signed decimal ints.
114Equivalent to
115.Fl t Ar dI .
116.It Fl j Ar skip
117Skip
118.Ar skip
119bytes of the combined input before dumping.
120The number may be followed by one
121of
122.Cm b , k
123or
124.Cm m
125which specify the units of the number as blocks (512 bytes), kilobytes and
126megabytes, respectively.
127.It Fl N Ar length
128Dump at most
129.Ar length
130bytes of input.
131.It Fl O
132Output octal ints.
133Equivalent to
134.Fl t Ar o4 .
135.It Fl s
136Output signed decimal shorts.
137Equivalent to
138.Fl t Ar d2 .
139.It Fl t Ar type
140Specify the output format.
141.Ar type
142is a string containing one or more of the following kinds of type specifiers:
143.Bl -tag -width indent
144.It Cm a
145Named characters
146.Pq Tn ASCII .
147Control characters are displayed using the following names:
148.Bl -column "000 nulx" "001 sohx" "002 stxx" "003 etxx" "004 eotx" "005 enqx"
149.It "000 nul" Ta "001 soh" Ta "002 stx" Ta "003 etx" Ta "004 eot" Ta "005 enq"
150.It "006 ack" Ta "007 bel" Ta "008 bs" Ta "009 ht" Ta "00A nl" Ta "00B vt"
151.It "00C ff" Ta "00D cr" Ta "00E so" Ta "00F si" Ta "010 dle" Ta "011 dc1"
152.It "012 dc2" Ta "013 dc3" Ta "014 dc4" Ta "015 nak" Ta "016 syn" Ta "017 etb"
153.It "018 can" Ta "019 em" Ta "01a sub" Ta "01B esc" Ta "01C fs" Ta "01D gs"
154.It "01E rs" Ta "01F us" Ta "020 sp" Ta "0FF del" Ta "" Ta ""
155.El
156.It Cm c
157Characters in the default character set.
158Non-printing characters are
159represented as 3-digit octal character codes, except the following
160characters, which are represented as C escapes:
161.Pp
162.Bl -tag -width carriage-return -compact
163.It NUL
164\e0
165.It alert
166\ea
167.It backspace
168\eb
169.It newline
170\en
171.It carriage-return
172\er
173.It tab
174\et
175.It vertical tab
176\ev
177.El
178.It Xo
179.Sm off
180.Op Cm d | o | u | x
181.Op Cm C | S | I | L | Ar n
182.Sm on
183.Xc
184Signed decimal
185.Pq Cm d ,
186octal
187.Pq Cm o ,
188unsigned decimal
189.Pq Cm u
190or
191hexadecimal
192.Pq Cm x .
193Followed by an optional size specifier, which may be either
194.Cm C
195.Pq Vt char ,
196.Cm S
197.Pq Vt short ,
198.Cm I
199.Pq Vt int ,
200.Cm L
201.Pq Vt long ,
202or a byte count as a decimal integer.
203.It Xo
204.Sm off
205.Cm f
206.Op Cm F | D | L | Ar n
207.Sm on
208.Xc
209Floating-point number.
210Followed by an optional size specifier, which may be either
211.Cm F
212.Pq Vt float ,
213.Cm D
214.Pq Vt double
215or
216.Cm L
217.Pq Vt "long double" .
218.El
219.It Fl v
220Write all input data, instead of replacing lines of duplicate values with a
221.Ql * .
222.El
223.Pp
224Multiple options that specify output format may be used; the output will
225contain one line for each format.
226.Pp
227If no output format is specified,
228.Fl t Ar oS
229is assumed.
230.Sh EXIT STATUS
231.Ex -std
232.Sh COMPATIBILITY
233The traditional
234.Fl s
235option to extract string constants is not supported; consider using
236.Xr strings 1
237instead.
238.Sh SEE ALSO
239.Xr hexdump 1 ,
240.Xr strings 1
241.Sh STANDARDS
242The
243.Nm
244utility conforms to
245.St -p1003.1-2001 .
246.Sh HISTORY
247An
248.Nm
249command appeared in
250.At v1 .