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