xref: /dragonfly/usr.bin/hexdump/od.1 (revision b40e316c)
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
59The
60.Nm
61utility is a filter which displays the specified files, or standard
62input if no files are specified, in a user specified format.
63.Pp
64The options are as follows:
65.Bl -tag -width ".Fl I , L , l"
66.It Fl A Ar base
67Specify the input address base.
68.Ar base
69may be one of
70.Cm d ,
71.Cm o ,
72.Cm x
73or
74.Cm n ,
75which specify decimal, octal, hexadecimal
76addresses or no address, respectively.
77.It Fl a
78Output named characters.
79Equivalent to
80.Fl t Ar a .
81.It Fl B , o
82Output octal shorts.
83Equivalent to
84.Fl t Ar o2 .
85.It Fl b
86Output octal bytes.
87Equivalent to
88.Fl t Ar o1 .
89.It Fl c
90Output C-style escaped characters.
91Equivalent to
92.Fl t Ar c .
93.It Fl D
94Output unsigned decimal ints.
95Equivalent to
96.Fl t Ar u4 .
97.It Fl e , F
98Output double-precision floating point numbers.
99Equivalent to
100.Fl t Ar fD .
101.It Fl f
102Output single-precision floating point numbers.
103Equivalent to
104.Fl t Ar fF .
105.It Fl H , X
106Output hexadecimal ints.
107Equivalent to
108.Fl t Ar x4 .
109.It Fl h , x
110Output hexadecimal shorts.
111Equivalent to
112.Fl t Ar x2 .
113.It Fl I , L , l
114Output signed decimal longs.
115Equivalent to
116.Fl t Ar dL .
117.It Fl i
118Output signed decimal ints.
119Equivalent to
120.Fl t Ar dI .
121.It Fl j Ar skip
122Skip
123.Ar skip
124bytes of the combined input before dumping.
125The number may be followed by one
126of
127.Cm b , k
128or
129.Cm m
130which specify the units of the number as blocks (512 bytes), kilobytes and
131megabytes, respectively.
132.It Fl N Ar length
133Dump at most
134.Ar length
135bytes of input.
136.It Fl O
137Output octal ints.
138Equivalent to
139.Fl t Ar o4 .
140.It Fl s
141Output signed decimal shorts.
142Equivalent to
143.Fl t Ar d2 .
144.It Fl t Ar type
145Specify the output format.
146.Ar type
147is a string containing one or more of the following kinds of type specifiers:
148.Bl -tag -width indent
149.It Cm a
150Named characters
151.Pq Tn ASCII .
152Control 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
162Characters in the default character set.
163Non-printing characters are
164represented as 3-digit octal character codes, except the following
165characters, 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
189Signed decimal
190.Pq Cm d ,
191octal
192.Pq Cm o ,
193unsigned decimal
194.Pq Cm u
195or
196hexadecimal
197.Pq Cm x .
198Followed 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 ,
207or 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
214Floating-point number.
215Followed by an optional size specifier, which may be either
216.Cm F
217.Pq Vt float ,
218.Cm D
219.Pq Vt double
220or
221.Cm L
222.Pq Vt "long double" .
223.El
224.It Fl v
225Write all input data, instead of replacing lines of duplicate values with a
226.Ql * .
227.El
228.Pp
229Multiple options that specify output format may be used; the output will
230contain one line for each format.
231.Pp
232If no output format is specified,
233.Fl t Ar oS
234is assumed.
235.Sh DIAGNOSTICS
236.Ex -std
237.Sh COMPATIBILITY
238The traditional
239.Fl s
240option to extract string constants is not supported; consider using
241.Xr strings 1
242instead.
243.Sh SEE ALSO
244.Xr hexdump 1 ,
245.Xr strings 1
246.Sh STANDARDS
247The
248.Nm
249utility conforms to
250.St -p1003.1-2001 .
251.Sh HISTORY
252An
253.Nm
254command appeared in
255.At v1 .
256