Section (1) hexdump
hexdump — display file contents in hexadecimal, decimal, octal, or ascii
The hexdump utility is a filter which displays the specified files, or standard input if no files are specified, in a user-specified format.
Below, the length and offset arguments may be followed by the multiplicative suffixes KiB (=1024), MiB (=1024*1024), and so on for GiB, TiB, PiB, EiB, ZiB and YiB (the iB is optional, e.g. K has the same meaning as KiB), or the suffixes KB (=1000), MB (=1000*1000), and so on for GB, TB, PB, EB, ZB and YB.
One-byte octal display. Display the input offset in hexadecimal, followed by sixteen space-separated, three-column, zero-filled bytes of input data, in octal, per line.
One-byte character display. Display the input offset in hexadecimal, followed by sixteen space-separated, three-column, space-filled characters of input data per line.
Canonical hex+ASCII display. Display the input offset in hexadecimal, followed by sixteen space-separated, two-column, hexadecimal bytes, followed by the same sixteen bytes in
%_pformat enclosed in _zsingle_quotesz_
Two-byte decimal display. Display the input offset in hexadecimal, followed by eight space-separated, five-column, zero-filled, two-byte units of input data, in unsigned decimal, per line.
Specify a format string to be used for displaying data.
Specify a file that contains one or more newline-separated format strings. Empty lines and lines whose first non-blank character is a hash mark (#) are ignored.
Accept color units for the output. The optional argument when can be auto, never or always. If the when argument is omitted, it defaults to auto. The colors can be disabled; for the current built-in default see the
−−helpoutput. See also the Colors subsection and the
Interpret only length bytes of input.
Two-byte octal display. Display the input offset in hexadecimal, followed by eight space-separated, six-column, zero-filled, two-byte quantities of input data, in octal, per line.
Skip offset bytes from the beginning of the input.
−voption causes hexdump to display all input data. Without the
−voption, any number of groups of output lines which would be identical to the immediately preceding group of output lines (except for the input offsets), are replaced with a line comprised of a single asterisk.
Two-byte hexadecimal display. Display the input offset in hexadecimal, followed by eight space-separated, four-column, zero-filled, two-byte quantities of input data, in hexadecimal, per line.
Display version information and exit.
Display help text and exit.
For each input file, hexdump sequentially copies
the input to standard output, transforming the data according
to the format strings specified by the
−f options, in the order that they were
A format string contains any number of format units, separated by whitespace. A format unit contains up to three items: an iteration count, a byte count, and a format.
The iteration count is an optional positive integer, which defaults to one. Each format is applied iteration count times.
The byte count is an optional positive integer. If specified it defines the number of bytes to be interpreted by each iteration of the format.
If an iteration count and/or a byte count is specified, a single slash must be placed after the iteration count and/or before the byte count to disambiguate them. Any whitespace before or after the slash is ignored.
The format is required and must be surrounded by double quote ( ) marks. It is interpreted as a fprintf-style format string (see fprintf(3), with the following exceptions:
An asterisk (*) may not be used as a field width or precision.
A byte count or field precision is required for each
sconversion character (unlike the fprintf(3) default which prints the entire string if the precision is unspecified).
The conversion characters
,andq are not supported.
The single character escape sequences described in the C standard are supported: