[BACK]Return to od.1 CVS log [TXT][DIR] Up to [local] / src / usr.bin / hexdump

Annotation of src/usr.bin/hexdump/od.1, Revision 1.11

1.11    ! deraadt     1: .\"  $OpenBSD: od.1,v 1.10 2003/01/06 08:47:58 deraadt 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
                     92: per line.  Control characters are printed as their names instead of as
1.11    ! deraadt    93: 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
                    101: octal, per line.  This is the default output style if no other is
                    102: selected.
                    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.10      deraadt   107: per line.  Control characters are printed as c style escapes, or as
1.9       pvalchev  108: three octal digits, if no c escape exists for the character.
                    109: .It Fl d
                    110: .Em Two-byte decimal display .
                    111: Display the input offset in octal, followed by eight
                    112: space-separated, five column, zero-filled, two-byte units
                    113: of input data, in unsigned decimal, per line.
                    114: .It Fl e
                    115: .Em Eight-byte floating point display .
                    116: Display the input offset in octal, followed by two space-separated,
                    117: twenty-one column, space filled, eight byte units of input data, in
                    118: floating point, per line.
                    119: .It Fl F
                    120: Same as
                    121: .Fl e .
                    122: .It Fl f
                    123: .Em Four-byte floating point display .
                    124: Display the input offset in octal, followed by four space-separated,
                    125: 14 column, space filled, four byte units of input data, in floating
                    126: point, per line.
                    127: .It Fl H
                    128: .Em Four-byte hex display .
                    129: Display the input offset in octal, followed by four space-separated,
                    130: eight column, zero filled, four byte units of input data, in hex,
                    131: per line.
                    132: .It Fl h
                    133: .Em Two-byte hex display .
                    134: Display the input offset in octal, followed by eight space-separated,
                    135: four column, zero filled, two byte units of input data, in hex,
                    136: per line.
                    137: .It Fl I
                    138: .Em Four-byte decimal display .
                    139: Display the input offset in octal, followed by four space-separated,
                    140: eleven column, space filled, four byte units of input data, in
                    141: decimal, per line.
                    142: .It Fl i
                    143: .Em Two-byte decimal display .
                    144: Display the input offset in octal, followed by eight space-separated,
                    145: six column, space filled, two-byte units of input data, in decimal,
                    146: per line.
                    147: .It Fl j Ar offset
                    148: Skip
                    149: .Ar offset
                    150: bytes from the beginning of the input.
                    151: By default,
                    152: .Ar offset
                    153: is interpreted as a decimal number.
                    154: With a leading
                    155: .Cm 0x
                    156: or
                    157: .Cm 0X ,
                    158: .Ar offset
                    159: is interpreted as a hexadecimal number,
                    160: otherwise, with a leading
                    161: .Cm 0 ,
                    162: .Ar offset
                    163: is interpreted as an octal number.
                    164: Appending the character
                    165: .Cm b ,
                    166: .Cm k ,
                    167: or
                    168: .Cm m
                    169: to
                    170: .Ar offset
                    171: causes it to be interpreted as a multiple of
                    172: .Li 512 ,
                    173: .Li 1024 ,
                    174: or
                    175: .Li 1048576 ,
                    176: respectively.
                    177: .It Fl L
                    178: Same as
                    179: .Fl I .
                    180: .It Fl l
                    181: Same as
                    182: .Fl I .
                    183: .It Fl N Ar length
                    184: Interpret only
                    185: .Ar length
                    186: bytes of input.
                    187: .It Fl O
                    188: .Em Four-byte octal display .
                    189: Display the input offset in octal, followed by four
                    190: space-separated, eleven column, zero-filled, four-byte units
                    191: of input data, in octal, per line.
                    192: .It Fl o
                    193: .Em Two-byte octal display .
                    194: Display the input offset in octal, followed by eight
                    195: space-separated, six column, zero-filled, two-byte units
                    196: of input data, in octal, per line.
                    197: .It Fl t Ar type_string
                    198: Specify one or more output types.  The
                    199: .Em type_string
                    200: option-argument must be a string specifying the types to be used when
                    201: writing the input data.  The string must consist of the type
                    202: specification characters:
                    203: .Pp
                    204: .Cm a
                    205: selects US-ASCII output, with control characters replaced with their
                    206: names instead of as c escape sequences.  See also the
                    207: .Cm _u
                    208: conversion provided by hexdump(1).
                    209: .Pp
                    210: .Cm c
                    211: selects a standard character based conversion.  See also the
                    212: .Cm _c
                    213: conversion provided by hexdump(1).
                    214: .Pp
                    215: .Cm f
                    216: selects the floating point output format.  This type character can be
                    217: optionally followed by the characters
                    218: .Cm 4
                    219: or
                    220: .Cm F
                    221: to specify four byte floating point output, or
                    222: .Cm 8
                    223: or
                    224: .Cm L
                    225: to specify eight byte floating point output.  The default output
                    226: format is eight byte floats.  See also the
                    227: .Cm e
                    228: conversion provided by hexdump(1).
                    229: .Pp
                    230: .Cm d ,
                    231: .Cm o ,
                    232: .Cm u ,
                    233: or
                    234: .Cm x
                    235: select decimal, octal, unsigned decimal, or hex output respectively.
                    236: These types can optionally be followed by
                    237: .Cm C
                    238: to specify
                    239: .Em char Ns -sized
                    240: output,
                    241: .Cm S
                    242: to specify
                    243: .Em short Ns -sized
                    244: output,
                    245: .Cm I
                    246: to specify
                    247: .Em int Ns -sized
                    248: output,
                    249: .Cm L
                    250: to specify
                    251: .Em long Ns -sized
                    252: output,
                    253: .Cm 1
                    254: to specify one-byte output,
                    255: .Cm 2
                    256: to specify two-byte output,
                    257: .Cm 4
                    258: to specify four-byte output, or
                    259: .Cm 8
                    260: to specify eight-byte output.  The default output format is in
                    261: four-byte quantities.  See also the
                    262: .Cm d ,
                    263: .Cm o ,
                    264: .Cm u ,
                    265: and
                    266: .Cm x
                    267: conversions provided by hexdump(1).
                    268: .\"(a|c|f[FLD]?|[doux][C1S2I4L8]?)*
                    269: .It Fl v
                    270: The
                    271: .Fl v
                    272: option causes
                    273: .Nm
                    274: to display all input data.
                    275: Without the
                    276: .Fl v
                    277: option, any number of groups of output lines, which would be
                    278: identical to the immediately preceding group of output lines (except
                    279: for the input offsets), are replaced with a line comprised of a
                    280: single asterisk.
                    281: .It Fl X
                    282: Same as
                    283: .Fl H .
                    284: .It Fl x
                    285: Same as
                    286: .Fl h .
                    287: .El
                    288: .Pp
                    289: For each input file,
                    290: .Nm
                    291: sequentially copies the input to standard output, transforming the
                    292: data according to the options given.  If no options are specified, the
                    293: default display is equivalent to specifying the
                    294: .Fl o
                    295: option.
                    296: .Pp
                    297: .Nm
                    298: exits 0 on success and >0 if an error occurred.
1.1       deraadt   299: .Sh SEE ALSO
                    300: .Xr hexdump 1 ,
                    301: .Xr strings 1
1.9       pvalchev  302: .Sh HISTORY
                    303: A
                    304: .Nm
                    305: command appears in
                    306: .At v1 .
                    307: .Pp
                    308: This man page was written in February 2001 by Andrew Brown, shortly
                    309: after he augmented the deprecated od syntax to include things he felt
                    310: had been missing for a long time.