| 1 | .\" Copyright (c) 1990, 1993 |
| 2 | .\" The Regents of the University of California. All rights reserved. |
| 3 | .\" |
| 4 | .\" Redistribution and use in source and binary forms, with or without |
| 5 | .\" modification, are permitted provided that the following conditions |
| 6 | .\" are met: |
| 7 | .\" 1. Redistributions of source code must retain the above copyright |
| 8 | .\" notice, this list of conditions and the following disclaimer. |
| 9 | .\" 2. Redistributions in binary form must reproduce the above copyright |
| 10 | .\" notice, this list of conditions and the following disclaimer in the |
| 11 | .\" documentation and/or other materials provided with the distribution. |
| 12 | .\" 3. Neither the name of the University nor the names of its contributors |
| 13 | .\" may be used to endorse or promote products derived from this software |
| 14 | .\" without specific prior written permission. |
| 15 | .\" |
| 16 | .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND |
| 17 | .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 18 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
| 19 | .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE |
| 20 | .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| 21 | .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
| 22 | .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
| 23 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
| 24 | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
| 25 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
| 26 | .\" SUCH DAMAGE. |
| 27 | .\" |
| 28 | .\" @(#)od.1 8.1 (Berkeley) 6/6/93 |
| 29 | .\" $FreeBSD: src/usr.bin/hexdump/od.1,v 1.8.2.5 2003/02/25 20:05:17 trhodes Exp $ |
| 30 | .\" |
| 31 | .Dd April 17, 2002 |
| 32 | .Dt OD 1 |
| 33 | .Os |
| 34 | .Sh NAME |
| 35 | .Nm od |
| 36 | .Nd octal, decimal, hex, ASCII dump |
| 37 | .Sh SYNOPSIS |
| 38 | .Nm |
| 39 | .Op Fl aBbcDdeFfHhIiLlOosvXx |
| 40 | .Op Fl A Ar base |
| 41 | .Op Fl j Ar skip |
| 42 | .Op Fl N Ar length |
| 43 | .Op Fl t Ar type |
| 44 | .Sm off |
| 45 | .Oo |
| 46 | .Op Cm \&+ |
| 47 | .Li offset |
| 48 | .Op Cm \&. |
| 49 | .Op Cm Bb |
| 50 | .Oc |
| 51 | .Sm on |
| 52 | .Op Ar |
| 53 | .Sh DESCRIPTION |
| 54 | The |
| 55 | .Nm |
| 56 | utility is a filter which displays the specified files, or standard |
| 57 | input if no files are specified, in a user specified format. |
| 58 | .Pp |
| 59 | The options are as follows: |
| 60 | .Bl -tag -width ".Fl I , L , l" |
| 61 | .It Fl A Ar base |
| 62 | Specify the input address base. |
| 63 | .Ar base |
| 64 | may be one of |
| 65 | .Cm d , |
| 66 | .Cm o , |
| 67 | .Cm x |
| 68 | or |
| 69 | .Cm n , |
| 70 | which specify decimal, octal, hexadecimal |
| 71 | addresses or no address, respectively. |
| 72 | .It Fl a |
| 73 | Output named characters. |
| 74 | Equivalent to |
| 75 | .Fl t Ar a . |
| 76 | .It Fl B , o |
| 77 | Output octal shorts. |
| 78 | Equivalent to |
| 79 | .Fl t Ar o2 . |
| 80 | .It Fl b |
| 81 | Output octal bytes. |
| 82 | Equivalent to |
| 83 | .Fl t Ar o1 . |
| 84 | .It Fl c |
| 85 | Output C-style escaped characters. |
| 86 | Equivalent to |
| 87 | .Fl t Ar c . |
| 88 | .It Fl D |
| 89 | Output unsigned decimal ints. |
| 90 | Equivalent to |
| 91 | .Fl t Ar u4 . |
| 92 | .It Fl e , F |
| 93 | Output double-precision floating point numbers. |
| 94 | Equivalent to |
| 95 | .Fl t Ar fD . |
| 96 | .It Fl f |
| 97 | Output single-precision floating point numbers. |
| 98 | Equivalent to |
| 99 | .Fl t Ar fF . |
| 100 | .It Fl H , X |
| 101 | Output hexadecimal ints. |
| 102 | Equivalent to |
| 103 | .Fl t Ar x4 . |
| 104 | .It Fl h , x |
| 105 | Output hexadecimal shorts. |
| 106 | Equivalent to |
| 107 | .Fl t Ar x2 . |
| 108 | .It Fl I , L , l |
| 109 | Output signed decimal longs. |
| 110 | Equivalent to |
| 111 | .Fl t Ar dL . |
| 112 | .It Fl i |
| 113 | Output signed decimal ints. |
| 114 | Equivalent to |
| 115 | .Fl t Ar dI . |
| 116 | .It Fl j Ar skip |
| 117 | Skip |
| 118 | .Ar skip |
| 119 | bytes of the combined input before dumping. |
| 120 | The number may be followed by one |
| 121 | of |
| 122 | .Cm b , k |
| 123 | or |
| 124 | .Cm m |
| 125 | which specify the units of the number as blocks (512 bytes), kilobytes and |
| 126 | megabytes, respectively. |
| 127 | .It Fl N Ar length |
| 128 | Dump at most |
| 129 | .Ar length |
| 130 | bytes of input. |
| 131 | .It Fl O |
| 132 | Output octal ints. |
| 133 | Equivalent to |
| 134 | .Fl t Ar o4 . |
| 135 | .It Fl s |
| 136 | Output signed decimal shorts. |
| 137 | Equivalent to |
| 138 | .Fl t Ar d2 . |
| 139 | .It Fl t Ar type |
| 140 | Specify the output format. |
| 141 | .Ar type |
| 142 | is a string containing one or more of the following kinds of type specifiers: |
| 143 | .Bl -tag -width indent |
| 144 | .It Cm a |
| 145 | Named characters |
| 146 | .Pq Tn ASCII . |
| 147 | Control characters are displayed using the following names: |
| 148 | .Bl -column "000 nulx" "001 sohx" "002 stxx" "003 etxx" "004 eotx" "005 enqx" |
| 149 | .It "000 nul" Ta "001 soh" Ta "002 stx" Ta "003 etx" Ta "004 eot" Ta "005 enq" |
| 150 | .It "006 ack" Ta "007 bel" Ta "008 bs" Ta "009 ht" Ta "00A nl" Ta "00B vt" |
| 151 | .It "00C ff" Ta "00D cr" Ta "00E so" Ta "00F si" Ta "010 dle" Ta "011 dc1" |
| 152 | .It "012 dc2" Ta "013 dc3" Ta "014 dc4" Ta "015 nak" Ta "016 syn" Ta "017 etb" |
| 153 | .It "018 can" Ta "019 em" Ta "01a sub" Ta "01B esc" Ta "01C fs" Ta "01D gs" |
| 154 | .It "01E rs" Ta "01F us" Ta "020 sp" Ta "0FF del" Ta "" Ta "" |
| 155 | .El |
| 156 | .It Cm c |
| 157 | Characters in the default character set. |
| 158 | Non-printing characters are |
| 159 | represented as 3-digit octal character codes, except the following |
| 160 | characters, which are represented as C escapes: |
| 161 | .Pp |
| 162 | .Bl -tag -width carriage-return -compact |
| 163 | .It NUL |
| 164 | \e0 |
| 165 | .It alert |
| 166 | \ea |
| 167 | .It backspace |
| 168 | \eb |
| 169 | .It newline |
| 170 | \en |
| 171 | .It carriage-return |
| 172 | \er |
| 173 | .It tab |
| 174 | \et |
| 175 | .It vertical tab |
| 176 | \ev |
| 177 | .El |
| 178 | .It Xo |
| 179 | .Sm off |
| 180 | .Op Cm d | o | u | x |
| 181 | .Op Cm C | S | I | L | Ar n |
| 182 | .Sm on |
| 183 | .Xc |
| 184 | Signed decimal |
| 185 | .Pq Cm d , |
| 186 | octal |
| 187 | .Pq Cm o , |
| 188 | unsigned decimal |
| 189 | .Pq Cm u |
| 190 | or |
| 191 | hexadecimal |
| 192 | .Pq Cm x . |
| 193 | Followed by an optional size specifier, which may be either |
| 194 | .Cm C |
| 195 | .Pq Vt char , |
| 196 | .Cm S |
| 197 | .Pq Vt short , |
| 198 | .Cm I |
| 199 | .Pq Vt int , |
| 200 | .Cm L |
| 201 | .Pq Vt long , |
| 202 | or a byte count as a decimal integer. |
| 203 | .It Xo |
| 204 | .Sm off |
| 205 | .Cm f |
| 206 | .Op Cm F | D | L | Ar n |
| 207 | .Sm on |
| 208 | .Xc |
| 209 | Floating-point number. |
| 210 | Followed by an optional size specifier, which may be either |
| 211 | .Cm F |
| 212 | .Pq Vt float , |
| 213 | .Cm D |
| 214 | .Pq Vt double |
| 215 | or |
| 216 | .Cm L |
| 217 | .Pq Vt "long double" . |
| 218 | .El |
| 219 | .It Fl v |
| 220 | Write all input data, instead of replacing lines of duplicate values with a |
| 221 | .Ql * . |
| 222 | .El |
| 223 | .Pp |
| 224 | Multiple options that specify output format may be used; the output will |
| 225 | contain one line for each format. |
| 226 | .Pp |
| 227 | If no output format is specified, |
| 228 | .Fl t Ar oS |
| 229 | is assumed. |
| 230 | .Sh EXIT STATUS |
| 231 | .Ex -std |
| 232 | .Sh COMPATIBILITY |
| 233 | The traditional |
| 234 | .Fl s |
| 235 | option to extract string constants is not supported; consider using |
| 236 | .Xr strings 1 |
| 237 | instead. |
| 238 | .Sh SEE ALSO |
| 239 | .Xr hexdump 1 , |
| 240 | .Xr strings 1 |
| 241 | .Sh STANDARDS |
| 242 | The |
| 243 | .Nm |
| 244 | utility conforms to |
| 245 | .St -p1003.1-2001 . |
| 246 | .Sh HISTORY |
| 247 | An |
| 248 | .Nm |
| 249 | command appeared in |
| 250 | .At v1 . |