Annotation of src/usr.bin/hexdump/od.1, Revision 1.13
1.13 ! jmc 1: .\" $OpenBSD: od.1,v 1.12 2003/06/10 09:12:10 jmc Exp $
1.9 pvalchev 2: .\" $NetBSD: od.1,v 1.16 2001/12/07 01:23:42 bjh21 Exp $
1.8 aaron 3: .\"
1.9 pvalchev 4: .\" Copyright (c) 2001 The NetBSD Foundation, Inc.
1.1 deraadt 5: .\" All rights reserved.
6: .\"
1.9 pvalchev 7: .\" This code is derived from software contributed to The NetBSD Foundation
8: .\" by Andrew Brown.
9: .\"
1.1 deraadt 10: .\" Redistribution and use in source and binary forms, with or without
11: .\" modification, are permitted provided that the following conditions
12: .\" are met:
13: .\" 1. Redistributions of source code must retain the above copyright
14: .\" notice, this list of conditions and the following disclaimer.
15: .\" 2. Redistributions in binary form must reproduce the above copyright
16: .\" notice, this list of conditions and the following disclaimer in the
17: .\" documentation and/or other materials provided with the distribution.
18: .\" 3. All advertising materials mentioning features or use of this software
19: .\" must display the following acknowledgement:
1.9 pvalchev 20: .\" This product includes software developed by the NetBSD
21: .\" Foundation, Inc. and its contributors.
22: .\" 4. Neither the name of The NetBSD Foundation nor the names of its
23: .\" contributors may be used to endorse or promote products derived
24: .\" from this software without specific prior written permission.
1.1 deraadt 25: .\"
1.9 pvalchev 26: .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
27: .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
28: .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29: .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
30: .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31: .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32: .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33: .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34: .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35: .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36: .\" POSSIBILITY OF SUCH DAMAGE.
37: .\"/
38: .Dd February 9, 2001
1.6 aaron 39: .Dt OD 1
1.1 deraadt 40: .Os
41: .Sh NAME
42: .Nm od
43: .Nd octal, decimal, hex, ascii dump
44: .Sh SYNOPSIS
45: .Nm od
46: .Op Fl aBbcDdeFfHhIiLlOovXx
1.9 pvalchev 47: .Bk -words
48: .Op Fl j Ar skip
49: .Ek
50: .Bk -words
51: .Op Fl N Ar length
52: .Ek
53: .Bk -words
54: .Op Fl t Ar type_string
55: .Ek
1.1 deraadt 56: .Sm off
57: .Oo
58: .Op Cm \&+
59: .Li offset
60: .Op Cm \&.
61: .Op Cm Bb
1.9 pvalchev 62: .Sm on
1.1 deraadt 63: .Oc
1.9 pvalchev 64: .Ar file ...
1.1 deraadt 65: .Sh DESCRIPTION
1.5 aaron 66: .Nm
1.1 deraadt 67: has been deprecated in favor of
68: .Xr hexdump 1 .
69: .Pp
1.9 pvalchev 70: .Xr hexdump 1 ,
1.1 deraadt 71: if called as
72: .Nm od ,
1.9 pvalchev 73: provides compatibility for the options described below.
1.1 deraadt 74: It does not provide compatibility for the
75: .Fl s
76: option (see
77: .Xr strings 1 )
78: or the
79: .Fl P ,
80: .Fl p ,
81: or
82: .Fl w
1.9 pvalchev 83: options, nor is compatibility provided for the ``label'' component
84: of the offset syntax.
85: .Pp
86: The options are as follows:
87: .Bl -tag -width Fl
88: .It Fl a
89: .Em One-byte character display .
90: Display the input offset in octal, followed by sixteen
91: space-separated, three column, space-filled, characters of input data
1.12 jmc 92: per line.
93: Control characters are printed as their names instead of as C-style escapes.
1.9 pvalchev 94: .It Fl B
95: Same as
96: .Fl o .
97: .It Fl b
98: .Em One-byte octal display .
99: Display the input offset in octal, followed by sixteen
100: space-separated, three column, zero-filled, bytes of input data, in
1.12 jmc 101: octal, per line.
102: This is the default output style if no other is selected.
1.9 pvalchev 103: .It Fl c
104: .Em One-byte character display .
105: Display the input offset in octal, followed by sixteen
106: space-separated, three column, space-filled, characters of input data
1.12 jmc 107: per line.
108: Control characters are printed as c style escapes, or as three octal digits,
109: if no c escape exists for the character.
1.9 pvalchev 110: .It Fl d
111: .Em Two-byte decimal display .
112: Display the input offset in octal, followed by eight
113: space-separated, five column, zero-filled, two-byte units
114: of input data, in unsigned decimal, per line.
115: .It Fl e
116: .Em Eight-byte floating point display .
117: Display the input offset in octal, followed by two space-separated,
118: twenty-one column, space filled, eight byte units of input data, in
119: floating point, per line.
120: .It Fl F
121: Same as
122: .Fl e .
123: .It Fl f
124: .Em Four-byte floating point display .
125: Display the input offset in octal, followed by four space-separated,
126: 14 column, space filled, four byte units of input data, in floating
127: point, per line.
128: .It Fl H
129: .Em Four-byte hex display .
130: Display the input offset in octal, followed by four space-separated,
131: eight column, zero filled, four byte units of input data, in hex,
132: per line.
133: .It Fl h
134: .Em Two-byte hex display .
135: Display the input offset in octal, followed by eight space-separated,
136: four column, zero filled, two byte units of input data, in hex,
137: per line.
138: .It Fl I
139: .Em Four-byte decimal display .
140: Display the input offset in octal, followed by four space-separated,
141: eleven column, space filled, four byte units of input data, in
142: decimal, per line.
143: .It Fl i
144: .Em Two-byte decimal display .
145: Display the input offset in octal, followed by eight space-separated,
146: six column, space filled, two-byte units of input data, in decimal,
147: per line.
148: .It Fl j Ar offset
149: Skip
150: .Ar offset
151: bytes from the beginning of the input.
152: By default,
153: .Ar offset
154: is interpreted as a decimal number.
155: With a leading
156: .Cm 0x
157: or
158: .Cm 0X ,
159: .Ar offset
160: is interpreted as a hexadecimal number,
161: otherwise, with a leading
162: .Cm 0 ,
163: .Ar offset
164: is interpreted as an octal number.
165: Appending the character
166: .Cm b ,
167: .Cm k ,
168: or
169: .Cm m
170: to
171: .Ar offset
172: causes it to be interpreted as a multiple of
173: .Li 512 ,
174: .Li 1024 ,
175: or
176: .Li 1048576 ,
177: respectively.
178: .It Fl L
179: Same as
180: .Fl I .
181: .It Fl l
182: Same as
183: .Fl I .
184: .It Fl N Ar length
185: Interpret only
186: .Ar length
187: bytes of input.
188: .It Fl O
189: .Em Four-byte octal display .
190: Display the input offset in octal, followed by four
191: space-separated, eleven column, zero-filled, four-byte units
192: of input data, in octal, per line.
193: .It Fl o
194: .Em Two-byte octal display .
195: Display the input offset in octal, followed by eight
196: space-separated, six column, zero-filled, two-byte units
197: of input data, in octal, per line.
198: .It Fl t Ar type_string
1.12 jmc 199: Specify one or more output types.
200: The
1.9 pvalchev 201: .Em type_string
202: option-argument must be a string specifying the types to be used when
1.12 jmc 203: writing the input data.
204: The string must consist of the type specification characters:
1.9 pvalchev 205: .Pp
206: .Cm a
207: selects US-ASCII output, with control characters replaced with their
1.12 jmc 208: names instead of as c escape sequences.
209: See also the
1.9 pvalchev 210: .Cm _u
1.12 jmc 211: conversion provided by
212: .Xr hexdump 1 .
1.9 pvalchev 213: .Pp
214: .Cm c
1.12 jmc 215: selects a standard character based conversion.
216: See also the
1.9 pvalchev 217: .Cm _c
1.12 jmc 218: conversion provided by
219: .Xr hexdump 1 .
1.9 pvalchev 220: .Pp
221: .Cm f
1.12 jmc 222: selects the floating point output format.
223: This type character can be optionally followed by the characters
1.9 pvalchev 224: .Cm 4
225: or
226: .Cm F
227: to specify four byte floating point output, or
228: .Cm 8
229: or
230: .Cm L
1.12 jmc 231: to specify eight byte floating point output.
232: The default output format is eight byte floats.
233: See also the
1.9 pvalchev 234: .Cm e
1.12 jmc 235: conversion provided by
236: .Xr hexdump 1 .
1.9 pvalchev 237: .Pp
238: .Cm d ,
239: .Cm o ,
240: .Cm u ,
241: or
242: .Cm x
243: select decimal, octal, unsigned decimal, or hex output respectively.
244: These types can optionally be followed by
245: .Cm C
246: to specify
247: .Em char Ns -sized
248: output,
249: .Cm S
250: to specify
251: .Em short Ns -sized
252: output,
253: .Cm I
254: to specify
255: .Em int Ns -sized
256: output,
257: .Cm L
258: to specify
259: .Em long Ns -sized
260: output,
261: .Cm 1
262: to specify one-byte output,
263: .Cm 2
264: to specify two-byte output,
265: .Cm 4
266: to specify four-byte output, or
267: .Cm 8
1.12 jmc 268: to specify eight-byte output.
269: The default output format is in four-byte quantities.
270: See also the
1.9 pvalchev 271: .Cm d ,
272: .Cm o ,
273: .Cm u ,
274: and
275: .Cm x
1.12 jmc 276: conversions provided by
277: .Xr hexdump 1 .
1.9 pvalchev 278: .\"(a|c|f[FLD]?|[doux][C1S2I4L8]?)*
279: .It Fl v
280: The
281: .Fl v
282: option causes
283: .Nm
284: to display all input data.
285: Without the
286: .Fl v
287: option, any number of groups of output lines, which would be
288: identical to the immediately preceding group of output lines (except
289: for the input offsets), are replaced with a line comprised of a
290: single asterisk.
291: .It Fl X
292: Same as
293: .Fl H .
294: .It Fl x
295: Same as
296: .Fl h .
297: .El
298: .Pp
299: For each input file,
300: .Nm
301: sequentially copies the input to standard output, transforming the
1.12 jmc 302: data according to the options given.
303: If no options are specified, the default display is equivalent to
304: specifying the
1.9 pvalchev 305: .Fl o
306: option.
307: .Pp
1.13 ! jmc 308: .Ex -std od
1.1 deraadt 309: .Sh SEE ALSO
310: .Xr hexdump 1 ,
311: .Xr strings 1
1.9 pvalchev 312: .Sh HISTORY
313: A
314: .Nm
315: command appears in
316: .At v1 .
317: .Pp
318: This man page was written in February 2001 by Andrew Brown, shortly
319: after he augmented the deprecated od syntax to include things he felt
320: had been missing for a long time.