blob: 9d43a750822b54900fac724b8eebb4cbc41fd8b0 [file] [log] [blame]
.TH XD 1
xd \- hex, octal, decimal, or ASCII dump
.B xd
.I option ...
.BI - "format ...
] [
.I file ...
.I Xd
concatenates and dumps the
.I 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
.B -c
are specified by pairs of characters telling size and style,
.L 4x
by default.
The sizes are
.TP \w'2\ or\ w\ \ \ 'u
.BR 1 " or " b
1-byte units.
.BR 2 " or " w
2-byte big-endian units.
.BR 4 " or " l
4-byte big-endian units.
.BR 8 " or " v
8-byte big-endian units.
The styles are
.TP 0
.B o
.B x
.B d
Other options are
.TP \w'\fL-a\fIstyle\fLXX'u
.B -c
Format as
.B 1x
but print
representations or C escape sequences where possible.
.BI -a style
Print file addresses in the given style (and size 4).
.B -u
(Unbuffered) Flush the output buffer after each 16-byte sequence.
.B -s
Reverse (swab) the order of bytes in each group of 4 before printing.
.B -S
Reverse the order of bytes in each group of 8 before printing.
.B -r
Print repeating groups of identical 16-byte sequences as the first group
followed by an asterisk.
.B \*9/src/cmd/xd.c
.IR db (1)
The various output formats don't line up properly in the output of
.IR xd .