OS Manuals

/usr/bin/xxd

Improved vi-style text editor

From vim 9.2.1316-r0 (os), captured 2026-11-10 by running xxd --help (exit 1). permalink

Usage:
       xxd [options] [infile [outfile]]
    or
       xxd -r [-s [-]offset] [-c cols] [-ps] [infile [outfile]]
Options:
    -a          toggle autoskip: A single '*' replaces nul-lines. Default off.
    -b          binary digit dump (incompatible with -ps). Default hex.
    -C          capitalize variable names in C include file style (-i).
    -c cols     format <cols> octets per line. Default 16 (-i: 12, -ps: 30).
    -E          show characters in EBCDIC. Default ASCII.
    -e          little-endian dump (incompatible with -ps,-i,-r).
    -g bytes    number of octets per group in normal output. Default 2 (-e: 4).
    -h          print this summary.
    -i          output in C include file style.
    -t          append terminating zero to C include output (-i).
    -l len      stop after <len> octets.
    -n name     set the variable name used in C include output (-i).
    -o off      add <off> to the displayed file position.
    -ps         output in postscript plain hexdump style.
    -r          reverse operation: convert (or patch) hexdump into binary.
    -r -s off   revert with <off> added to file positions found in hexdump.
    -d          show offset in decimal instead of hex.
    -s [+][-]seek  start at <seek> bytes abs. (or +: rel.) infile offset.
    -u          use upper case hex letters.
    -R when     colorize the output; <when> can be 'always', 'auto' or 'never'. Default: 'auto'.
    -v          show version: "xxd 2026-06-16 by Juergen Weigert et al.".
Options (21)
OptionDescriptionSource
-a, -autoskiptoggle autoskip: A single '*' replaces nul-lines.help + man
-b, -bitsSwitch to bits (binary digits) dump, rather than hex dump.help + man
-C, -capitalizeCapitalize variable names in C include file style, when using -i.help + man
-c, -cols colsformat <cols> octets per line.help + man
-E, -EBCDICChange the character encoding in the righthand column from ASCII to EBCDIC.help + man
-elittle-endian dump (incompatible with -ps,-i,-r).help + man
-g, -groupsize bytesSeparate the output of every <bytes> bytes (two hex characters or eight bit digits each) by a whitespace.help + man
-h, -helpPrint a summary of available commands and exit.help + man
-i, -includeoutput in C include file style.help + man
-tWhen outputting in C include file style using -i include the terminating zero.help + man
-l, -len lenStop after writing <len> octets.help + man
-n, -name nameset the variable name used in C include output (-i).help + man
-o offAdd <offset> to the displayed file position.help + man
-ps, -p, -postscript, -plainOutput in PostScript continuous hex dump style.help + man
-r, -revertReverse operation: convert (or patch) hex dump into binary.help + man
-dshow offset in decimal instead of hex.help + man
-s +][-]seekstart at <seek> bytes abs.help
-uuse upper case hex letters.help + man
-R whenIn the output both the data column (hex, or bits with -b) and the character column are colored with the same color depending on the byte value.help + man
-v, -versionshow version: "xxd 2026-06-16 by Juergen Weigert et al.".help + man
-seek offsetWhen used after -r: revert with <offset> added to file positions found in hex dump. (in the manual page but not in --help)man
Exit status (4) from the manual page
0no errors encountered.
1error while parsing options.
2problems with input file.
3problems with output file.

Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.