[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.25

1.25    ! jmc         1: .\"  $OpenBSD: od.1,v 1.24 2010/10/07 16:59:01 sobrado 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.25    ! jmc        31: .Dd $Mdocdate: October 7 2010 $
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.1       deraadt    40: .Op Fl aBbcDdeFfHhIiLlOovXx
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.5       aaron      56: .Nm
1.1       deraadt    57: has been deprecated in favor of
                     58: .Xr hexdump 1 .
                     59: .Pp
1.9       pvalchev   60: .Xr hexdump 1 ,
1.1       deraadt    61: if called as
                     62: .Nm od ,
1.9       pvalchev   63: provides compatibility for the options described below.
1.1       deraadt    64: It does not provide compatibility for the
                     65: .Fl s
                     66: option (see
                     67: .Xr strings 1 )
                     68: or the
                     69: .Fl P ,
                     70: .Fl p ,
                     71: or
                     72: .Fl w
1.9       pvalchev   73: options, nor is compatibility provided for the ``label'' component
                     74: of the offset syntax.
                     75: .Pp
                     76: The options are as follows:
                     77: .Bl -tag -width Fl
1.22      fgsch      78: .It Fl A Ar base
                     79: Specify the input address base.
                     80: The argument
                     81: .Ar base
                     82: may be one of
                     83: .Cm d ,
                     84: .Cm o ,
                     85: .Cm x ,
                     86: or
                     87: .Cm n ,
                     88: which specify decimal, octal, hexadecimal
                     89: addresses or no address, respectively.
1.9       pvalchev   90: .It Fl a
                     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 their names instead of as C-style escapes.
1.9       pvalchev   96: .It Fl B
                     97: Same as
                     98: .Fl o .
                     99: .It Fl b
                    100: .Em One-byte octal display .
                    101: Display the input offset in octal, followed by sixteen
                    102: space-separated, three column, zero-filled, bytes of input data, in
1.12      jmc       103: octal, per line.
                    104: This is the default output style if no other is selected.
1.9       pvalchev  105: .It Fl c
                    106: .Em One-byte character display .
                    107: Display the input offset in octal, followed by sixteen
                    108: space-separated, three column, space-filled, characters of input data
1.12      jmc       109: per line.
                    110: Control characters are printed as c style escapes, or as three octal digits,
                    111: if no c escape exists for the character.
1.15      otto      112: .It Fl D
1.16      jmc       113: .Em Four-byte octal display .
1.15      otto      114: Display the input offset in octal, followed by four space-separated,
                    115: ten column, space filled, four-byte units of input data, in octal, per line.
1.9       pvalchev  116: .It Fl d
                    117: .Em Two-byte decimal display .
                    118: Display the input offset in octal, followed by eight
                    119: space-separated, five column, zero-filled, two-byte units
                    120: of input data, in unsigned decimal, per line.
                    121: .It Fl e
                    122: .Em Eight-byte floating point display .
                    123: Display the input offset in octal, followed by two space-separated,
1.17      otto      124: twenty-one column, space filled, eight-byte units of input data, in
1.9       pvalchev  125: floating point, per line.
                    126: .It Fl F
                    127: Same as
                    128: .Fl e .
                    129: .It Fl f
                    130: .Em Four-byte floating point display .
                    131: Display the input offset in octal, followed by four space-separated,
1.17      otto      132: 14 column, space filled, four-byte units of input data, in floating
1.9       pvalchev  133: point, per line.
                    134: .It Fl H
                    135: .Em Four-byte hex display .
                    136: Display the input offset in octal, followed by four space-separated,
1.17      otto      137: eight column, zero filled, four-byte units of input data, in hex,
1.9       pvalchev  138: per line.
                    139: .It Fl h
                    140: .Em Two-byte hex display .
                    141: Display the input offset in octal, followed by eight space-separated,
1.17      otto      142: four column, zero filled, two-byte units of input data, in hex,
1.9       pvalchev  143: per line.
                    144: .It Fl I
                    145: .Em Four-byte decimal display .
                    146: Display the input offset in octal, followed by four space-separated,
1.17      otto      147: eleven column, space filled, four-byte units of input data, in
1.9       pvalchev  148: decimal, per line.
                    149: .It Fl i
                    150: .Em Two-byte decimal display .
                    151: Display the input offset in octal, followed by eight space-separated,
                    152: six column, space filled, two-byte units of input data, in decimal,
                    153: per line.
                    154: .It Fl j Ar offset
                    155: Skip
                    156: .Ar offset
                    157: bytes from the beginning of the input.
                    158: By default,
                    159: .Ar offset
                    160: is interpreted as a decimal number.
                    161: With a leading
                    162: .Cm 0x
                    163: or
                    164: .Cm 0X ,
                    165: .Ar offset
                    166: is interpreted as a hexadecimal number,
                    167: otherwise, with a leading
                    168: .Cm 0 ,
                    169: .Ar offset
                    170: is interpreted as an octal number.
                    171: Appending the character
                    172: .Cm b ,
                    173: .Cm k ,
                    174: or
                    175: .Cm m
                    176: to
                    177: .Ar offset
                    178: causes it to be interpreted as a multiple of
                    179: .Li 512 ,
                    180: .Li 1024 ,
                    181: or
                    182: .Li 1048576 ,
                    183: respectively.
                    184: .It Fl L
                    185: Same as
                    186: .Fl I .
                    187: .It Fl l
                    188: Same as
                    189: .Fl I .
                    190: .It Fl N Ar length
                    191: Interpret only
                    192: .Ar length
                    193: bytes of input.
                    194: .It Fl O
                    195: .Em Four-byte octal display .
                    196: Display the input offset in octal, followed by four
                    197: space-separated, eleven column, zero-filled, four-byte units
                    198: of input data, in octal, per line.
                    199: .It Fl o
                    200: .Em Two-byte octal display .
                    201: Display the input offset in octal, followed by eight
                    202: space-separated, six column, zero-filled, two-byte units
                    203: of input data, in octal, per line.
                    204: .It Fl t Ar type_string
1.12      jmc       205: Specify one or more output types.
                    206: The
1.9       pvalchev  207: .Em type_string
                    208: option-argument must be a string specifying the types to be used when
1.12      jmc       209: writing the input data.
                    210: The string must consist of the type specification characters:
1.9       pvalchev  211: .Pp
                    212: .Cm a
                    213: selects US-ASCII output, with control characters replaced with their
1.12      jmc       214: names instead of as c escape sequences.
                    215: See also the
1.9       pvalchev  216: .Cm _u
1.12      jmc       217: conversion provided by
                    218: .Xr hexdump 1 .
1.9       pvalchev  219: .Pp
                    220: .Cm c
1.12      jmc       221: selects a standard character based conversion.
                    222: See also the
1.9       pvalchev  223: .Cm _c
1.12      jmc       224: conversion provided by
                    225: .Xr hexdump 1 .
1.9       pvalchev  226: .Pp
                    227: .Cm f
1.12      jmc       228: selects the floating point output format.
                    229: This type character can be optionally followed by the characters
1.9       pvalchev  230: .Cm 4
                    231: or
                    232: .Cm F
1.17      otto      233: to specify four-byte floating point output, or
1.9       pvalchev  234: .Cm 8
                    235: or
                    236: .Cm L
1.17      otto      237: to specify eight-byte floating point output.
                    238: The default output format is eight-byte floats.
1.12      jmc       239: See also the
1.9       pvalchev  240: .Cm e
1.12      jmc       241: conversion provided by
                    242: .Xr hexdump 1 .
1.9       pvalchev  243: .Pp
                    244: .Cm d ,
                    245: .Cm o ,
                    246: .Cm u ,
                    247: or
                    248: .Cm x
                    249: select decimal, octal, unsigned decimal, or hex output respectively.
                    250: These types can optionally be followed by
                    251: .Cm C
                    252: to specify
                    253: .Em char Ns -sized
                    254: output,
                    255: .Cm S
                    256: to specify
                    257: .Em short Ns -sized
                    258: output,
                    259: .Cm I
                    260: to specify
                    261: .Em int Ns -sized
                    262: output,
                    263: .Cm L
                    264: to specify
                    265: .Em long Ns -sized
                    266: output,
                    267: .Cm 1
                    268: to specify one-byte output,
                    269: .Cm 2
                    270: to specify two-byte output,
                    271: .Cm 4
                    272: to specify four-byte output, or
                    273: .Cm 8
1.12      jmc       274: to specify eight-byte output.
                    275: The default output format is in four-byte quantities.
                    276: See also the
1.9       pvalchev  277: .Cm d ,
                    278: .Cm o ,
                    279: .Cm u ,
                    280: and
                    281: .Cm x
1.12      jmc       282: conversions provided by
                    283: .Xr hexdump 1 .
1.9       pvalchev  284: .\"(a|c|f[FLD]?|[doux][C1S2I4L8]?)*
                    285: .It Fl v
                    286: The
                    287: .Fl v
                    288: option causes
                    289: .Nm
                    290: to display all input data.
                    291: Without the
                    292: .Fl v
                    293: option, any number of groups of output lines, which would be
                    294: identical to the immediately preceding group of output lines (except
                    295: for the input offsets), are replaced with a line comprised of a
                    296: single asterisk.
                    297: .It Fl X
                    298: Same as
                    299: .Fl H .
                    300: .It Fl x
                    301: Same as
                    302: .Fl h .
                    303: .El
                    304: .Pp
                    305: For each input file,
                    306: .Nm
                    307: sequentially copies the input to standard output, transforming the
1.12      jmc       308: data according to the options given.
                    309: If no options are specified, the default display is equivalent to
                    310: specifying the
1.9       pvalchev  311: .Fl o
                    312: option.
1.23      jmc       313: .Sh EXIT STATUS
1.13      jmc       314: .Ex -std od
1.1       deraadt   315: .Sh SEE ALSO
                    316: .Xr hexdump 1 ,
                    317: .Xr strings 1
1.9       pvalchev  318: .Sh HISTORY
1.18      jmc       319: The
                    320: .Nm
                    321: utility is compliant with the
1.21      jmc       322: .St -p1003.1-2008
1.18      jmc       323: specification.
                    324: .Pp
                    325: The flags
                    326: .Op Fl aBDeFfHhIiLlOX
                    327: are extensions to that specification.
                    328: .Pp
1.25    ! jmc       329: An
1.9       pvalchev  330: .Nm
                    331: command appears in
                    332: .At v1 .
                    333: .Pp
                    334: This man page was written in February 2001 by Andrew Brown, shortly
                    335: after he augmented the deprecated od syntax to include things he felt
                    336: had been missing for a long time.