od ( 1 ) USER COMMANDSod ( 1 )


NAME

od - dump files in octal or other formats

SYNOPSIS

od [ options ] [ file ... ] [ [+]offset[.|b|k|m|ll|LL] ]

DESCRIPTION

od dumps the contents of the input files in various formats on the standard output. The standard input is read if - or no files are specified. Each output line contains the file offset of the data in the leftmost column, followed by one or more columns in the specified format. If more than one format is specified then the subsequent lines are listed with the offset column blank. Second and subsequent occurrences of a repeated output line are replaced by a single line with `*' in the first data column.

If the output format is specified by one of the obsolete forms (not -t) then the last file argument is interpreted as an offset expression if it matches the extended regular expression +?[0-9]+\.?[bkm]?(ll|LL)? . In this case the first offset bytes of the file are skipped. The optional b means bytes, k means Kb, and m means Mb. ll and LL are ignored for compatibility with some systems.

OPTIONS

-A, --address-radix=radix
The file offset radix.
d
decimal
o
octal
x
hexadecimal
n
none - do not print offset
The default value is o.
-B, --swap=op
Swap input bytes according to the bit mask op, which is the inclusive or of:
01
swap 8-bit bytes
02
swap 16-bit words
04
swap 32-bit longs
0
swap for big endian testing
-j, --skip-bytes=bytes
Skip bytes bytes into the data before formatting.
-N, --count|read-bytes=bytes
Output only bytes bytes of data.
-m, --map=codeset
--printable and --format=m bytes are converted from codeset to the native codeset. The codesets are:
ascii
8 bit ascii
ebcdic
X/Open ebcdic
o|ebcdic-o
mvs OpenEdition ebcdic
h|ebcdic-h
ibm OS/400 AS/400 ebcdic
s|ebcdic-s
siemens posix-bc ebcdic
i|ebcdic-i
X/Open ibm ebcdic (not idempotent)
m|ebcdic-m
mvs ebcdic
u|ebcdic-u
microfocus cobol ebcdic
native
native code set
-p, --printable
Output the printable bytes (after --map if specified), in the last data column. Non-printable byte values are printed as `.'.
-z, --strings[=length]
Output NUL terminated strings of at least length bytes. The option value may be omitted. The default value is 3.
-t, --format|type=format[size]
The data item output format and size. A decimal byte count or size code may follow all but the a, c and m formats.
a
named character (ASCII 3-characters)
b
binary character
c
ASCII character or backslash escape
d
signed decimal
f
floating point
m
--map mapped character or hexadecimal value if not printable
o
octal
u
unsigned decimal
x
hexadecimal
z
printable bytes
----- sizes -----
C
sizeof(char)
S
sizeof(short)
I
sizeof(int)
L|l
sizeof(long)
D|ll
sizeof(long long)
F
sizeof(float)
D
sizeof(double)
L
sizeof(long double)
The default value is o2.
-T, --test=test
Enable internal implementation specific tests.
bn
Allocate a fixed input buffer of size n.
mn
Set the mapped input buffer size to n.
n
Turn off the SF_SHARE input buffer flag.
-v, --all|output-duplicates
Output all data.
-w, --per-line|width=per-line
The number of items to format per output line. per-line must be a multiple of the least common multiple of the sizes of the format types.
-a
Equivalent to -ta.
-b
Equivalent to -toC.
-c
Equivalent to -tc.
-d
Equivalent to -tuS.
-D
Equivalent to -tuL.
-f
Equivalent to -tfF.
-F
Equivalent to -tfD.
-h
Equivalent to -txS.
-i
Equivalent to -tdS.
-l
Equivalent to -tdL.
-o
Equivalent to -toS.
-O
Equivalent to -toL.
-s
Equivalent to -tdS.
-S
Equivalent to -tdL.
-u
Equivalent to -tuS.
-U
Equivalent to -tuL.
-x
Equivalent to -txS.
-X
Equivalent to -txL.

SEE ALSO

sed(1), strings(1), swap(3), ascii(5)

IMPLEMENTATION

version
od (AT&T Research) 2006-10-31
author
Glenn Fowler <gsf@research.att.com>
author
David Korn <dgk@research.att.com>
copyright
Copyright © 1992-2008 AT&T Intellectual Property
license
http://www.opensource.org/licenses/cpl1.0.txt