fatbase

portable OpenBSD tools
git clone git@git.2f30.org/fatbase.git
Log | Files | Refs

od.1 (8532B)


      1 .\"  $OpenBSD: od.1,v 1.30 2014/04/19 09:24:28 sobrado Exp $
      2 .\"  $NetBSD: od.1,v 1.16 2001/12/07 01:23:42 bjh21 Exp $
      3 .\"
      4 .\" Copyright (c) 2001 The NetBSD Foundation, Inc.
      5 .\" All rights reserved.
      6 .\"
      7 .\" This code is derived from software contributed to The NetBSD Foundation
      8 .\" by Andrew Brown.
      9 .\"
     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 .\"
     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 .\"/
     31 .Dd $Mdocdate: April 19 2014 $
     32 .Dt OD 1
     33 .Os
     34 .Sh NAME
     35 .Nm od
     36 .Nd octal, decimal, hex, ascii dump
     37 .Sh SYNOPSIS
     38 .Nm od
     39 .Bk -words
     40 .Op Fl aBbcDdeFfHhIiLlOosvXx
     41 .Op Fl A Ar base
     42 .Op Fl j Ar offset
     43 .Op Fl N Ar length
     44 .Op Fl t Ar type_string
     45 .Sm off
     46 .Oo
     47 .Op Cm \&+
     48 .Li offset
     49 .Op Cm \&.
     50 .Op Cm Bb
     51 .Sm on
     52 .Oc
     53 .Op Ar
     54 .Ek
     55 .Sh DESCRIPTION
     56 The
     57 .Nm
     58 utility is a filter which displays the specified files, or standard
     59 input if no files are specified, in a user specified format.
     60 .Pp
     61 The options are as follows:
     62 .Bl -tag -width Fl
     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.
     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
     79 per line.
     80 Control characters are printed as their names instead of as C-style escapes.
     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
     88 octal, per line.
     89 This is the default output style if no other is selected.
     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
     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.
     97 .It Fl D
     98 .Em Four-byte octal display .
     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.
    101 .It Fl d
    102 .Em Two-byte unsigned 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,
    109 twenty-one column, space filled, eight-byte units of input data, in
    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,
    117 14 column, space filled, four-byte units of input data, in floating
    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,
    122 eight column, zero filled, four-byte units of input data, in hex,
    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,
    127 four column, zero filled, two-byte units of input data, in hex,
    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,
    132 eleven column, space filled, four-byte units of input data, in
    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 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.
    194 .It Fl t Ar type_string
    195 Specify one or more output types.
    196 The
    197 .Em type_string
    198 option-argument must be a string specifying the types to be used when
    199 writing the input data.
    200 The string must consist of the type specification characters:
    201 .Pp
    202 .Cm a
    203 selects US-ASCII output, with control characters replaced with their
    204 names instead of as c escape sequences.
    205 See also the
    206 .Cm _u
    207 conversion provided by
    208 .Xr hexdump 1 .
    209 .Pp
    210 .Cm c
    211 selects a standard character based conversion.
    212 See also the
    213 .Cm _c
    214 conversion provided by
    215 .Xr hexdump 1 .
    216 .Pp
    217 .Cm f
    218 selects the floating point output format.
    219 This type character can be optionally followed by the characters
    220 .Cm 4
    221 or
    222 .Cm F
    223 to specify four-byte floating point output, or
    224 .Cm 8
    225 or
    226 .Cm L
    227 to specify eight-byte floating point output.
    228 The default output format is eight-byte floats.
    229 See also the
    230 .Cm e
    231 conversion provided by
    232 .Xr hexdump 1 .
    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
    264 to specify eight-byte output.
    265 The default output format is in four-byte quantities.
    266 See also the
    267 .Cm d ,
    268 .Cm o ,
    269 .Cm u ,
    270 and
    271 .Cm x
    272 conversions provided by
    273 .Xr hexdump 1 .
    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
    298 data according to the options given.
    299 If no options are specified, the default display is equivalent to
    300 specifying the
    301 .Fl o
    302 option.
    303 .Sh EXIT STATUS
    304 .Ex -std od
    305 .Sh SEE ALSO
    306 .Xr hexdump 1
    307 .Sh STANDARDS
    308 The
    309 .Nm
    310 utility is compliant with the
    311 .St -p1003.1-2008
    312 specification.
    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.
    323 .Pp
    324 The flags
    325 .Op Fl aBDeFfHhIiLlOX
    326 are extensions to that specification.
    327 .Sh HISTORY
    328 An
    329 .Nm
    330 command appears in
    331 .At v1 .
    332 .Pp
    333 This man page was written in February 2001 by Andrew Brown, shortly
    334 after he augmented the
    335 .Nm
    336 syntax to include things he felt had been missing for a long time.