Skip to content
SysTutorials
  • SysTutorialsExpand
    • Linux & Systems Administration Academy
    • Web3 & Crypto Academy
    • Programming Academy
    • Systems & Architecture Academy
  • Subscribe
  • Linux Manuals
  • Search
SysTutorials
Linux Manuals / Linux Manuals session 1

hexdump (1) Linux Manual Page

ByLinux Manual Posted onApr 19, 2026May 20, 2026 Updated onMay 20, 2026

NAME

hexdump – display file contents in hexadecimal, decimal, octal, or ascii

hexdump options file …

hd options file …

DESCRIPTION

The hexdump utility is a filter which displays the specified files, or standard input if no files are specified, in a user-specified format.

OPTIONS

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.

-b, –one-byte-octal

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.

-c, –one-byte-char

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.

-C, –canonical

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 %_p format enclosed in ‘|‘ characters. Invoking the program as hd implies this option.

-d, –two-bytes-decimal

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.

-e, –format format_string

Specify a format string to be used for displaying data.

-f, –format-file file

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.

-L, –color[=when]

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 –help output. See also the Colors subsection and the COLORS section below.

-n, –length length

Interpret only length bytes of input.

-o, –two-bytes-octal

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.

-s, –skip offset

Skip offset bytes from the beginning of the input.

-v, –no-squeezing

The -v option causes hexdump to display all input data. Without the -v option, 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.

-x, –two-bytes-hex

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.

-V, –version

Display version information and exit.

-h, –help

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 -e and -f options, in the order that they were specified.

FORMATS

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:

1.

An asterisk (*) may not be used as a field width or precision.

2.

A byte count or field precision is required for each s conversion character (unlike the fprintf3 default which prints the entire string if the precision is unspecified).

3.

The conversion characters h, l, n, p, and q are not supported.

4.

The single character escape sequences described in the C standard are supported:

NULL

Post navigation

Previous Previous
hexchat (1) Linux Manual Page
NextContinue
hexedit (1) Linux Manual Page

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Categories

  • AI Engineering (4)
  • Algorithms & Data Structures (14)
  • Blockchain & Cryptocurrency (16)
  • Code Optimization (8)
  • Databases & Storage (11)
  • Design Patterns & Architecture (18)
  • Development Best Practices (104)
  • Functional Programming (4)
  • Languages & Frameworks (97)
  • Linux & Systems Administration (726)
  • Linux Manuals (56,856)
    • Linux Manuals session 1 (13,267)
    • Linux Manuals session 2 (502)
    • Linux Manuals session 3 (32,502)
    • Linux Manuals session 4 (117)
    • Linux Manuals session 5 (1,724)
    • Linux Manuals session 7 (887)
    • Linux Manuals session 8 (4,721)
    • Linux Manuals session 9 (3,136)
  • Linux System Configuration (33)
  • Object-Oriented Programming (4)
  • Programming Languages (129)
  • Scripting & Utilities (68)
  • Security & Cryptography (17)
  • System Administration & Cloud (33)
  • Systems & Architecture (36)
  • Testing & DevOps (33)
  • Web Development (25)

SysTutorials, Terms, Privacy

  • SysTutorials
    • Linux & Systems Administration Academy
    • Web3 & Crypto Academy
    • Programming Academy
    • Systems & Architecture Academy
  • Subscribe
  • Linux Manuals
  • Search