Manual Page Result
0
Command: xd | Section: 1 | Source: UNIX v10 | File: xd.1
XD(1) General Commands Manual XD(1)
NAME
xd, od - hex, octal, decimal, or ASCII dump
SYNOPSIS
xd [ option ... ] [ -format ... ] [ file ... ]
od [ -bcdox ] [ file ] [ +offset ]
DESCRIPTION
Xd concatenates and dumps the files (standard input by default) in one
or more formats. Groups of 16 bytes are printed in each of the named
formats, one format per line. Each line of output is prefixed by its
address (byte offset) in the input file. The first line of output for
each group is zero-padded; subsequent are blank-padded.
Formats other than -c are specified by pairs of characters telling size
and style, by default. The sizes are
1 or b 1-byte units.
2 or w 2-byte units.
4 or l 4-byte units.
The styles are
o Octal.
x Hexadecimal.
d Decimal.
Other options are
-c Format as 1x but print ASCII representations or C escape se-
quences where possible.
-astyle
Print file addresses in the given style (and size 4).
-s Reverse (swab) the order of bytes in each group of 4 before
printing.
-r Print repeating groups of identical 16-byte sequences as the
first group followed by an asterisk.
Od dumps a file or the standard input in one or more formats as se-
lected by the first argument, octal by default.
The format characters mean
b Bytes in octal.
c Bytes in ASCII with C escapes and 3-digit octal for other char-
acters.
d 16-bit words in decimal.
o 16-bit words in octal.
x 16-bit words in hex.
The offset argument tells where in the file to begin dumping. The off-
set, normally interpreted in octal, is interpreted in hexadecimal if it
begins with or and in decimal if it ends with or If it ends in it is
multiplied by 512. The preceding + may be omitted if file is present.
SEE ALSO
adb(1), strings(1), vis(1)
BUGS
The various output formats don't line up properly in the output of xd.
A spurious zero byte reported by od at the end of odd-length files is
betrayed by the correctly printed final address.
The offset is ineffectual if lseek(2) won't work on the file.
On some raw devices offsets must be a multiple of the natural block
size.
XD(1)