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. All advertising materials mentioning features or use of this software 13.\" must display the following acknowledgement: 14.\" This product includes software developed by the University of 15.\" California, Berkeley and its contributors. 16.\" 4. Neither the name of the University nor the names of its contributors 17.\" may be used to endorse or promote products derived from this software 18.\" without specific prior written permission. 19.\" 20.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30.\" SUCH DAMAGE. 31.\" 32.\" @(#)od.1 8.1 (Berkeley) 6/6/93 33.\" $FreeBSD$ 34.\" 35.Dd July 11, 2004 36.Os 37.Dt OD 1 38.Sh NAME 39.Nm od 40.Nd octal, decimal, hex, ASCII dump 41.Sh SYNOPSIS 42.Nm 43.Op Fl aBbcDdeFfHhIiLlOosvXx 44.Op Fl A Ar base 45.Op Fl j Ar skip 46.Op Fl N Ar length 47.Op Fl t Ar type 48.Sm off 49.Oo 50.Op Cm \&+ 51.Li offset 52.Op Cm \&. 53.Op Cm Bb 54.Oc 55.Sm on 56.Op Ar 57.Sh DESCRIPTION 58The 59.Nm 60utility is a filter which displays the specified files, or standard 61input if no files are specified, in a user specified format. 62.Pp 63The options are as follows: 64.Bl -tag -width ".Fl I , L , l" 65.It Fl A Ar base 66Specify the input address base. 67.Ar base 68may be one of 69.Cm d , 70.Cm o , 71.Cm x 72or 73.Cm n , 74which specify decimal, octal, hexadecimal 75addresses or no address, respectively. 76.It Fl a 77Output named characters. 78Equivalent to 79.Fl t Ar a . 80.It Fl B , o 81Output octal shorts. 82Equivalent to 83.Fl t Ar o2 . 84.It Fl b 85Output octal bytes. 86Equivalent to 87.Fl t Ar o1 . 88.It Fl c 89Output C-style escaped characters. 90Equivalent to 91.Fl t Ar c . 92.It Fl D 93Output unsigned decimal ints. 94Equivalent to 95.Fl t Ar u4 . 96.It Fl e , F 97Output double-precision floating point numbers. 98Equivalent to 99.Fl t Ar fD . 100.It Fl f 101Output single-precision floating point numbers. 102Equivalent to 103.Fl t Ar fF . 104.It Fl H , X 105Output hexadecimal ints. 106Equivalent to 107.Fl t Ar x4 . 108.It Fl h , x 109Output hexadecimal shorts. 110Equivalent to 111.Fl t Ar x2 . 112.It Fl I , L , l 113Output signed decimal longs. 114Equivalent to 115.Fl t Ar dL . 116.It Fl i 117Output signed decimal ints. 118Equivalent to 119.Fl t Ar dI . 120.It Fl j Ar skip 121Skip 122.Ar skip 123bytes of the combined input before dumping. 124The number may be followed by one 125of 126.Cm b , k 127or 128.Cm m 129which specify the units of the number as blocks (512 bytes), kilobytes and 130megabytes, respectively. 131.It Fl N Ar length 132Dump at most 133.Ar length 134bytes of input. 135.It Fl O 136Output octal ints. 137Equivalent to 138.Fl t Ar o4 . 139.It Fl s 140Output signed decimal shorts. 141Equivalent to 142.Fl t Ar d2 . 143.It Fl t Ar type 144Specify the output format. 145.Ar type 146is a string containing one or more of the following kinds of type specifiers: 147.Bl -tag -width indent 148.It Cm a 149Named characters 150.Pq Tn ASCII . 151Control characters are displayed using the following names: 152.Bl -column "000 NUL" "001 SOH" "002 STX" "003 ETX" "004 EOT" "005 ENQ" 153.It "000 NUL 001 SOH 002 STX 003 ETX 004 EOT 005 ENQ" 154.It "006 ACK 007 BEL 008 BS 009 HT 00a NL 00b VT" 155.It "00c FF 00d CR 00e SO 00f SI 010 DLE 011 DC1" 156.It "012 DC2 013 DC3 014 DC4 015 NAK 016 SYN 017 ETB" 157.It "018 CAN 019 EM 01a SUB 01b ESC 01c FS 01d GS" 158.It "01e RS 01f US 020 SP 0ff DEL" 159.El 160.It Cm c 161Characters in the default character set. 162Non-printing characters are 163represented as 3-digit octal character codes, except the following 164characters, which are represented as C escapes: 165.Pp 166.Bl -tag -width carriage-return -compact 167.It NUL 168\e0 169.It alert 170\ea 171.It backspace 172\eb 173.It newline 174\en 175.It carriage-return 176\er 177.It tab 178\et 179.It vertical tab 180\ev 181.El 182.Pp 183Multi-byte characters are displayed in the area corresponding to the first 184byte of the character. The remaining bytes are shown as 185.Ql ** . 186.It Xo 187.Sm off 188.Op Cm d | o | u | x 189.Op Cm C | S | I | L | Ar n 190.Sm on 191.Xc 192Signed decimal 193.Pq Cm d , 194octal 195.Pq Cm o , 196unsigned decimal 197.Pq Cm u 198or 199hexadecimal 200.Pq Cm x . 201Followed by an optional size specifier, which may be either 202.Cm C 203.Pq Vt char , 204.Cm S 205.Pq Vt short , 206.Cm I 207.Pq Vt int , 208.Cm L 209.Pq Vt long , 210or a byte count as a decimal integer. 211.It Xo 212.Sm off 213.Cm f 214.Op Cm F | D | L | Ar n 215.Sm on 216.Xc 217Floating-point number. 218Followed by an optional size specifier, which may be either 219.Cm F 220.Pq Vt float , 221.Cm D 222.Pq Vt double 223or 224.Cm L 225.Pq Vt "long double" . 226.El 227.It Fl v 228Write all input data, instead of replacing lines of duplicate values with a 229.Ql * . 230.El 231.Pp 232Multiple options that specify output format may be used; the output will 233contain one line for each format. 234.Pp 235If no output format is specified, 236.Fl t Ar oS 237is assumed. 238.Sh ENVIRONMENT 239The 240.Ev LANG , LC_ALL 241and 242.Ev LC_CTYPE 243environment variables affect the execution of 244.Nm 245as described in 246.Xr environ 7 . 247.Sh DIAGNOSTICS 248.Ex -std 249.Sh COMPATIBILITY 250The traditional 251.Fl s 252option to extract string constants is not supported; consider using 253.Xr strings 1 254instead. 255.Sh SEE ALSO 256.Xr hexdump 1 , 257.Xr strings 1 258.Sh STANDARDS 259The 260.Nm 261utility conforms to 262.St -p1003.1-2001 . 263.Sh HISTORY 264An 265.Nm 266command appeared in 267.At v1 . 268