Annotation of src/usr.bin/hexdump/od.1, Revision 1.30
1.30 ! sobrado 1: .\" $OpenBSD: od.1,v 1.29 2014/04/15 21:00:13 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.28 sobrado 31: .Dd $Mdocdate: April 15 2014 $
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
1.24 sobrado 39: .Bk -words
1.27 sobrado 40: .Op Fl aBbcDdeFfHhIiLlOosvXx
1.22 fgsch 41: .Op Fl A Ar base
1.14 jmc 42: .Op Fl j Ar offset
1.9 pvalchev 43: .Op Fl N Ar length
44: .Op Fl t Ar type_string
1.1 deraadt 45: .Sm off
46: .Oo
47: .Op Cm \&+
48: .Li offset
49: .Op Cm \&.
50: .Op Cm Bb
1.9 pvalchev 51: .Sm on
1.1 deraadt 52: .Oc
1.14 jmc 53: .Op Ar
1.24 sobrado 54: .Ek
1.1 deraadt 55: .Sh DESCRIPTION
1.26 sobrado 56: The
1.5 aaron 57: .Nm
1.26 sobrado 58: utility is a filter which displays the specified files, or standard
59: input if no files are specified, in a user specified format.
1.9 pvalchev 60: .Pp
61: The options are as follows:
62: .Bl -tag -width Fl
1.22 fgsch 63: .It Fl A Ar base
64: Specify the input address base.
65: The argument
66: .Ar base
67: may be one of
68: .Cm d ,
69: .Cm o ,
70: .Cm x ,
71: or
72: .Cm n ,
73: which specify decimal, octal, hexadecimal
74: addresses or no address, respectively.
1.9 pvalchev 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
1.27 sobrado 102: .Em Two-byte unsigned decimal display .
1.9 pvalchev 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.
1.27 sobrado 189: .It Fl s
190: .Em Two-byte signed decimal display .
191: Display the input offset in octal, followed by eight
192: space-separated, five column, zero-filled, two-byte units
193: of input data, in signed decimal, per line.
1.9 pvalchev 194: .It Fl t Ar type_string
1.12 jmc 195: Specify one or more output types.
196: The
1.9 pvalchev 197: .Em type_string
198: option-argument must be a string specifying the types to be used when
1.12 jmc 199: writing the input data.
200: The string must consist of the type specification characters:
1.9 pvalchev 201: .Pp
202: .Cm a
203: selects US-ASCII output, with control characters replaced with their
1.12 jmc 204: names instead of as c escape sequences.
205: See also the
1.9 pvalchev 206: .Cm _u
1.12 jmc 207: conversion provided by
208: .Xr hexdump 1 .
1.9 pvalchev 209: .Pp
210: .Cm c
1.12 jmc 211: selects a standard character based conversion.
212: See also the
1.9 pvalchev 213: .Cm _c
1.12 jmc 214: conversion provided by
215: .Xr hexdump 1 .
1.9 pvalchev 216: .Pp
217: .Cm f
1.12 jmc 218: selects the floating point output format.
219: This type character can be optionally followed by the characters
1.9 pvalchev 220: .Cm 4
221: or
222: .Cm F
1.17 otto 223: to specify four-byte floating point output, or
1.9 pvalchev 224: .Cm 8
225: or
226: .Cm L
1.17 otto 227: to specify eight-byte floating point output.
228: The default output format is eight-byte floats.
1.12 jmc 229: See also the
1.9 pvalchev 230: .Cm e
1.12 jmc 231: conversion provided by
232: .Xr hexdump 1 .
1.9 pvalchev 233: .Pp
234: .Cm d ,
235: .Cm o ,
236: .Cm u ,
237: or
238: .Cm x
239: select decimal, octal, unsigned decimal, or hex output respectively.
240: These types can optionally be followed by
241: .Cm C
242: to specify
243: .Em char Ns -sized
244: output,
245: .Cm S
246: to specify
247: .Em short Ns -sized
248: output,
249: .Cm I
250: to specify
251: .Em int Ns -sized
252: output,
253: .Cm L
254: to specify
255: .Em long Ns -sized
256: output,
257: .Cm 1
258: to specify one-byte output,
259: .Cm 2
260: to specify two-byte output,
261: .Cm 4
262: to specify four-byte output, or
263: .Cm 8
1.12 jmc 264: to specify eight-byte output.
265: The default output format is in four-byte quantities.
266: See also the
1.9 pvalchev 267: .Cm d ,
268: .Cm o ,
269: .Cm u ,
270: and
271: .Cm x
1.12 jmc 272: conversions provided by
273: .Xr hexdump 1 .
1.9 pvalchev 274: .\"(a|c|f[FLD]?|[doux][C1S2I4L8]?)*
275: .It Fl v
276: The
277: .Fl v
278: option causes
279: .Nm
280: to display all input data.
281: Without the
282: .Fl v
283: option, any number of groups of output lines, which would be
284: identical to the immediately preceding group of output lines (except
285: for the input offsets), are replaced with a line comprised of a
286: single asterisk.
287: .It Fl X
288: Same as
289: .Fl H .
290: .It Fl x
291: Same as
292: .Fl h .
293: .El
294: .Pp
295: For each input file,
296: .Nm
297: sequentially copies the input to standard output, transforming the
1.12 jmc 298: data according to the options given.
299: If no options are specified, the default display is equivalent to
300: specifying the
1.9 pvalchev 301: .Fl o
302: option.
1.23 jmc 303: .Sh EXIT STATUS
1.13 jmc 304: .Ex -std od
1.1 deraadt 305: .Sh SEE ALSO
1.27 sobrado 306: .Xr hexdump 1
1.28 sobrado 307: .Sh STANDARDS
1.18 jmc 308: The
309: .Nm
310: utility is compliant with the
1.21 jmc 311: .St -p1003.1-2008
1.18 jmc 312: specification.
1.29 jmc 313: .Pp
314: The flags
315: .Op Fl bcdosx
316: as well as the
317: .Ar offset
318: specifier are marked by
319: .St -p1003.1-2008
320: as being an
321: X/Open System Interfaces
322: option.
1.18 jmc 323: .Pp
324: The flags
325: .Op Fl aBDeFfHhIiLlOX
326: are extensions to that specification.
1.28 sobrado 327: .Sh HISTORY
1.25 jmc 328: An
1.9 pvalchev 329: .Nm
330: command appears in
331: .At v1 .
332: .Pp
333: This man page was written in February 2001 by Andrew Brown, shortly
1.30 ! sobrado 334: after he augmented the
! 335: .Nm
! 336: syntax to include things he felt had been missing for a long time.