1od(1) User Commands od(1)
2
3
4
6 od - octal dump
7
9 /usr/bin/od [-bcCDdFfOoSsvXx] [-] [file] [offset_string]
10
11
12 /usr/bin/od [-bcCDdFfOoSsvXx] [-A address_base] [-j skip]
13 [-N count] [-t type_string]... [-] [file]...
14
15
16 /usr/xpg4/bin/od [-bcCDdFfOoSsvXx] [file] [offset_string]
17
18
19 /usr/xpg4/bin/od [-bcCDdFfOoSsvXx] [-A address_base]
20 [-j skip] [-N count] [-t type_string]... [file]...
21
22
24 The od command copies sequentially each input file to standard output
25 and transforms the input data according to the output types specified
26 by the -t or -bcCDdFfOoSsvXx options. If no output type is specified,
27 the default output is as if -t o2 had been specified. Multiple types
28 can be specified by using multiple -bcCDdFfOoSstvXx options. Output
29 lines are written for each type specified in the order in which the
30 types are specified. If no file is specified, the standard input is
31 used. The [offset_string] operand is mutually exclusive from the -A,
32 -j, -N, and -t options. For the purposes of this description, the fol‐
33 lowing terms are used:
34
35 word Refers to a 16-bit unit, independent of the word
36 size of the machine.
37
38
39 long word Refers to a 32-bit unit.
40
41
42 double long word Refers to a 64-bit unit.
43
44
46 The following options are supported:
47
48 -A address_base Specifies the input offset base. The address_base
49 option-argument must be a character. The charac‐
50 ters d, o and x specify that the offset base will
51 be written in decimal, octal or hexadecimal,
52 respectively. The character n specifies that the
53 offset will not be written. Unless -A n is speci‐
54 fied, the output line will be preceded by the input
55 offset, cumulative across input files, of the next
56 byte to be written. In addition, the offset of the
57 byte following the last byte written will be dis‐
58 played after all the input data has been processed.
59 Without the -A address_base option and the [off‐
60 set_string] operand, the input offset base is dis‐
61 played in octal.
62
63
64 -b Interprets bytes in octal. This is equivalent to
65 -t o1.
66
67
68 /usr/bin/od
69 -c Displays single-byte characters. Certain non-graphic characters
70 appear as C-language escapes:
71
72 null \0
73 backspace \b
74 form-feed \f
75 new-line \n
76 return \r
77 tab \t
78
79
80 Others appear as 3-digit octal numbers. For example:
81
82 echo "hello world" | od −c
83 0000000 h e l l o w o r l d \n
84 0000014
85
86
87
88
89 /usr/xpg4/bin/od
90 -c Interprets bytes as single-byte or multibyte charac‐
91 ters according to the current setting of the
92 LC_CTYPE locale category. Printable multibyte char‐
93 acters are written in the area corresponding to the
94 first byte of the character. The two-character
95 sequence ** is written in the area corresponding to
96 each remaining byte in the character, as an indica‐
97 tion that the character is continued. Non-graphic
98 characters appear the same as they would using the
99 -C option.
100
101
102 -C Interprets bytes as single-byte or multibyte charac‐
103 ters according to the current setting of the
104 LC_CTYPE locale category. Printable multibyte char‐
105 acters are written in the area corresponding to the
106 first byte of the character. The two-character
107 sequence ** is written in the area corresponding to
108 each remaining byte in the character, as an indica‐
109 tion that the character is continued. Certain non-
110 graphic characters appear as C escapes:
111
112 null \0
113 backspace \b
114 form-feed \f
115 new-line \n
116 return \r
117 tab \t
118
119
120 Other non-printable characters appear as one three-
121 digit octal number for each byte in the character.
122
123
124 -d Interprets words in unsigned decimal. This is
125 equivalent to -t u2.
126
127
128 -D Interprets long words in unsigned decimal. This is
129 equivalent to -t u4.
130
131
132 -f Interprets long words in floating point. This is
133 equivalent to -t f4.
134
135
136 -F Interprets double long words in extended precision.
137 This is equivalent to -t f8.
138
139
140 -j skip Jumps over skip bytes from the beginning of the
141 input. The od command will read or seek past the
142 first skip bytes in the concatenated input files.
143 If the combined input is not at least skip bytes
144 long, the od command will write a diagnostic message
145 to standard error and exit with a non-zero exit sta‐
146 tus.
147
148 By default, the skip option-argument is interpreted
149 as a decimal number. With a leading 0x or 0X, the
150 offset is interpreted as a hexadecimal number; oth‐
151 erwise, with a leading 0, the offset will be inter‐
152 preted as an octal number. Appending the character
153 b, k, or m to offset will cause it to be interpreted
154 as a multiple of 512, 1024 or 1048576 bytes, respec‐
155 tively. If the skip number is hexadecimal, any
156 appended b is considered to be the final hexadecimal
157 digit. The address is displayed starting at 0000000,
158 and its base is not implied by the base of the skip
159 option-argument.
160
161
162 -N count Formats no more than count bytes of input. By
163 default, count is interpreted as a decimal number.
164 With a leading 0x or 0X, count is interpreted as a
165 hexadecimal number; otherwise, with a leading 0, it
166 is interpreted as an octal number. If count bytes of
167 input (after successfully skipping, if -jskip is
168 specified) are not available, it will not be consid‐
169 ered an error. The od command will format the input
170 that is available. The base of the address dis‐
171 played is not implied by the base of the count
172 option-argument.
173
174
175 -o Interprets words in octal. This is equivalent to -t
176 o2.
177
178
179 -O Interprets long words in unsigned octal. This is
180 equivalent to -t o4.
181
182
183 -s Interprets words in signed decimal. This is equiva‐
184 lent to -t d2.
185
186
187 -S Interprets long words in signed decimal. This is
188 equivalent to -t d4.
189
190
191 -t type_string Specifies one or more output types. The type_string
192 option-argument must be a string specifying the
193 types to be used when writing the input data. The
194 string must consist of the type specification char‐
195 acters:
196
197 a Named character. Interprets bytes as named
198 characters. Only the least significant seven
199 bits of each byte will be used for this type
200 specification. Bytes with the values listed in
201 the following table will be written using the
202 corresponding names for those characters.
203
204 The following are named characters in od:
205
206 Value Name
207
208 00 nul
209 01 soh
210 02 stx
211 03 etx
212 04 eot
213 05 enq
214 06 ack
215 07 bel
216 10 bs
217 11 ht
218 12 lf
219 13 vt
220 14 ff
221 15 cr
222 16 so
223 17 si
224 20 dle
225 21 dc1
226 22 dc2
227 23 dc3
228 24 dc4
229 25 nak
230 26 syn
231 27 etb
232 30 can
233 31 em
234 32 sub
235 33 esc
236 34 fs
237 35 gs
238 36 rs
239 37 us
240 40 sp
241 177 del
242
243
244
245
246 c Character. Interprets bytes as single-byte or
247 multibyte characters specified by the current
248 setting of the LC_CTYPE locale category.
249 Printable multibyte characters are written in
250 the area corresponding to the first byte of
251 the character. The two-character sequence **
252 is written in the area corresponding to each
253 remaining byte in the character, as an indica‐
254 tion that the character is continued. Certain
255 non-graphic characters appear as C escapes:
256 \0, \a, \b, \f, \n, \r, \t, \v. Other non-
257 printable characters appear as one three-digit
258 octal number for each byte in the character.
259
260 The type specification characters d, f, o, u, and x
261 can be followed by an optional unsigned decimal
262 integer that specifies the number of bytes to be
263 transformed by each instance of the output type.
264
265 f Floating point. Can be followed by
266 an optional F, D, or L indicating
267 that the conversion should be
268 applied to an item of type float,
269 double, or long double, respec‐
270 tively.
271
272
273 d, o, u, and x Signed decimal, octal, unsigned
274 decimal, and hexadecimal, respec‐
275 tively. Can be followed by an
276 optional C, S, I, or L indicating
277 that the conversion should be
278 applied to an item of type char,
279 short, int, or long, respectively.
280
281 Multiple types can be concatenated within the same
282 type_string and multiple -t options can be speci‐
283 fied. Output lines are written for each type speci‐
284 fied in the order in which the type specification
285 characters are specified.
286
287
288 -v Shows all input data (verbose). Without the -v
289 option, all groups of output lines that would be
290 identical to the immediately preceding output line
291 (except for byte offsets), will be replaced with a
292 line containing only an asterisk (*).
293
294
295 -x Interprets words in hex. This is equivalent to -t
296 x2.
297
298
299 -X Interprets long words in hex. This is equivalent to
300 -t x4.
301
302
304 /usr/bin/od
305 The following operands are supported for /usr/bin/od only:
306
307 − Uses the standard input in addition to any
308 files specified. When this operand is not
309 given, the standard input is used only if no
310 file operands are specified.
311
312
313 file A path name of a file to be read. If no file
314 operands are specified, the standard input
315 will be used. If there are no more than two
316 operands, none of the -A, -j, -N, or -t
317 options is specified, and any of the follow‐
318 ing are true:
319
320 1. the first character of the last
321 operand is a plus sign (+)
322
323 2. the first character of the second
324 operand is numeric
325
326 3. the first character of the second
327 operand is x and the second char‐
328 acter of the second operand is a
329 lower-case hexadecimal character
330 or digit
331
332 4. the second operand is named "x"
333
334 5. the second operand is named "."
335 then the corresponding operand is assumed to
336 be an offset operand rather than a file oper‐
337 and.
338
339 Without the -N count option, the display con‐
340 tinues until an end-of-file is reached.
341
342
343 [+][0] offset [.][b|B] The offset_string operand specifies the byte
344 [+][0][offset] [.] offset in the file where dumping is to com‐
345 [+][0x|x][offset] mence. The offset is interpreted in octal
346 [+][0x|x] offset[B] bytes by default. If offset begins with "0",
347 it is interpreted in octal. If offset begins
348 with "x" or "0x", it is interpreted in hexa‐
349 decimal and any appended "b" is considered to
350 be the final hexadecimal digit. If "." is
351 appended, the offset is interpreted in deci‐
352 mal. If "b" or "B" is appended, the offset is
353 interpreted in units of 512 bytes. If the
354 file argument is omitted, the offset argument
355 must be preceded by a plus sign (+). The
356 address is displayed starting at the given
357 offset. The radix of the address will be the
358 same as the radix of the offset, if speci‐
359 fied, otherwise it will be octal. Decimal
360 overrides octal, and it is an error to spec‐
361 ify both hexadecimal and decimal conversions
362 in the same offset operand.
363
364
365 /usr/xpg4/bin/od
366 The following operands are supported for /usr/xpg4/bin/od only:
367
368 file Same as /usr/bin/od, except only one of
369 the first two conditions must be true.
370
371
372 [+] [0] offset [.][b|B] Description of offset_string is the same
373 + [offset] [.] as for /usr/bin/od.
374 [+][0x][offset]
375 [+][0x] offset[B]
377 +Sxeoeffesnevtir[oBn][22m(5) for descriptions of the following environment variables
378 that affect the execution of od: LANG, LC_ALL, LC_CTYPE, LC_MESSAGES,
379 LC_NUMERIC, and NLSPATH.
380
382 The following exit values are returned:
383
384 0 Successful completion.
385
386
387 >0 An error occurred.
388
389
391 See attributes(5) for descriptions of the following attributes:
392
393 /usr/bin/od
394 ┌─────────────────────────────┬─────────────────────────────┐
395 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
396 ├─────────────────────────────┼─────────────────────────────┤
397 │Availability │SUNWtoo │
398 ├─────────────────────────────┼─────────────────────────────┤
399 │CSI │enabled │
400 └─────────────────────────────┴─────────────────────────────┘
401
402 /usr/xpg4/bin/od
403 ┌─────────────────────────────┬─────────────────────────────┐
404 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
405 ├─────────────────────────────┼─────────────────────────────┤
406 │Availability │SUNWxcu4 │
407 ├─────────────────────────────┼─────────────────────────────┤
408 │CSI │enabled │
409 ├─────────────────────────────┼─────────────────────────────┤
410 │Interface Stability │Standard │
411 └─────────────────────────────┴─────────────────────────────┘
412
414 sed(1), attributes(5), environ(5), standards(5)
415
416
417
418SunOS 5.11 20 May 2005 od(1)