Home Explore Blog CI



man-pages

2nd chunk of `hd.man`
505d7550b5f25b1a09def01893978fea5c62f06d25f2cf0900000001000011d9
 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.

       -h, --help
           Display help text and exit.

       -V, --version
           Print version 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 fprintf(3) 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              │ \0 │
          ├───────────────────┼────┤
          │                   │    │
          │ <alert character> │ \a │
          ├───────────────────┼────┤
          │                   │    │
          │ <backspace>       │ \b │
          ├───────────────────┼────┤
          │                   │    │
          │ <form-feed>       │ \f │
          ├───────────────────┼────┤
          │                   │    │
          │ <newline>         │ \n │
          ├───────────────────┼────┤
          │                   │    │
          │ <carriage return> │ \r │
          ├───────────────────┼────┤
          │                   │    │
          │ <tab>             │ \t │
          ├───────────────────┼────┤
          │                   │    │
          │ <vertical tab>    │ \v │
          └───────────────────┴────┘

   Conversion strings
       The hexdump utility also supports the following additional
       conversion strings.

       _a[dox]
           Display the input offset, cumulative across input files, of
           the next byte to be displayed. The appended characters d, o,
           and x specify the display base as decimal, octal or
           hexadecimal respectively.

       _A[dox]
           Almost identical to the _a conversion string except that it
           is only performed once, when all of the input data has been
           processed.

       _c
           Output characters in the default character set. Non-printing
           characters are displayed in three-character, zero-padded
           octal, except for those representable by standard

Title: hexdump Options and Format String Details
Summary
This section details additional hexdump command options including suppressing duplicate output lines, specifying a two-byte hexadecimal display, displaying help, and printing the version. It then dives into the specifics of hexdump format strings, explaining their components: iteration count, byte count, and format. It outlines the syntax for using these components and describes how hexdump interprets format strings, noting differences from fprintf. Finally, it lists supported conversion strings including those for displaying input offsets and characters in the default character set.