OD(1) | General Commands Manual | OD(1) |
od
— octal,
decimal, hex, ASCII dump
od |
[-aBbcDdeFfHhIiLlOosvXx ]
[-A base]
[-j skip]
[-N length]
[-t type]
[[+ ]offset[. ][Bb ]]
[file ...] |
The od
utility is a filter which displays
the specified files, or standard input if no files are specified, in a user
specified format.
The options are as follows:
-A
based
, o
,
x
or n
, which specify
decimal, octal, hexadecimal addresses or no address, respectively.-a
-t
a
.-B
,
-o
-t
o2
.-b
-t
o1
.-c
-t
c
.-D
-t
u4
.-d
-t
u2
.-e
,
-F
-t
fD
.-f
-t
fF
.-H
,
-X
-t
x4
.-h
,
-x
-t
x2
.-I
,
-L
, -l
-t
dL
.-i
-t
dI
.-j
skipb
,
k
, m
or
g
which specify the units of the number as blocks
(512 bytes), kilobytes, megabytes and gigabytes, respectively.-N
length-O
-t
o4
.-s
-t
d2
.-t
typea
000 NUL | 001 SOH | 002 STX | 003 ETX | 004 EOT | 005 ENQ |
006 ACK | 007 BEL | 008 BS | 009 HT | 00A NL | 00B VT |
00C FF | 00D CR | 00E SO | 00F SI | 010 DLE | 011 DC1 |
012 DC2 | 013 DC3 | 014 DC4 | 015 NAK | 016 SYN | 017 ETB |
018 CAN | 019 EM | 01A SUB | 01B ESC | 01C FS | 01D GS |
01E RS | 01F US | 020 SP | 07F DEL |
c
Multi-byte characters are displayed in the area
corresponding to the first byte of the character. The remaining
bytes are shown as ‘**
’.
d
|o
|u
|x
][C
|S
|I
|L
|n]d
), octal
(o
), unsigned decimal
(u
) or hexadecimal
(x
). Followed by an optional size specifier,
which may be either C
(char), S
(short), I
(int), L
(long), or a byte count as a decimal
integer.f
[F
|D
|L
|n]F
(float),
D
(double) or
L
(long double).-v
*
’.Multiple options that specify output format may be used; the output will contain one line for each format.
If no output format is specified, -t
oS
is assumed.
The LANG
, LC_ALL
and LC_CTYPE
environment variables affect the
execution of od
as described in
environ(7).
The od
utility exits 0 on success,
and >0 if an error occurs.
Dump stdin and show the output using named characters and C-style escaped characters:
$ echo "FreeBSD: The power to serve" | od -a -c 0000000 F r e e B S D : sp T h e sp p o w F r e e B S D : T h e p o w 0000020 e r sp t o sp s e r v e nl e r t o s e r v e \n 0000034
Dump stdin skipping the first 13 bytes using named characters and dumping no more than 5 bytes:
$ echo "FreeBSD: The power to serve" | od -An -a -j 13 -N 5 p o w e r
The traditional -s
option to extract
string constants is not supported; consider using
strings(1) instead.
The od
utility conforms to
IEEE Std 1003.1-2001 (“POSIX.1”).
An od
command appeared in
Version 1 AT&T UNIX.
December 22, 2011 | macOS 15.2 |