HEXD(1)
π HEXD(1) β human-friendly hexdump tool π
okay so bestie, welcome to the General Commands Manual page for hexd β no cap, this little tool is lowkey iconic and has main character energy when it comes to looking at binary data. Let's go π
β¨ NAME β¨
hexd β human-friendly hexdump tool
π¦ SYNOPSIS π¦
hexd [-p] [-P] [-v] [-g groupsize] [-r range] [-w width] [file ...]
π DESCRIPTION π
hexd prints a human-readable hexdump of the files you name, or standard input if you don't name any. Its main distinguishing feature is literally the colours: they visually indicate which range of values an octet belongs to, which is highkey useful for spotting patterns in binary data. The colour-coding? Obsessed. It ate. It's giving βbinary data but make it readableβ β periodt β¨
The ranges an octet is classified into are:
- zero β
0x00 - low β
0x01..0x1F - printable β
0x20..0x7E - high β
0x7F..0xFE - all β
0xFF
By default, colours are used if output is a terminal, and omitted if not.
Repeated output lines are collapsed into only one copy followed by a line with only *, unless -v is used.
π OPTIONS π
If no file operands are specified, standard input is read instead. Available options are listed below.
-hβ Print usage information.-pβ Plain: disable colours/formatting.-Pβ Pretty: enable colours/formatting.-vβ Verbose: show every hexdump line (don't collapse repetition with*).-g groupsizeβ Number of octets per group, set to8by default.-r rangeβ Range of octets to print from each file. Specified as eitherstart-endorstart+count, wherestartandend/countare positive integers specified in either decimal, hexadecimal or octal (C-style notation).
When the former syntax is used, both ends of the range are optional and default to the start or end of the file when omitted.
-w widthβ Number of octets per line, separated into groups (see-g). Set to16by default.
π ENVIRONMENT π
HEXD_COLORS can be used to override the formatting used by hexd to classify octets. If set, it should consist of space-separated pairs of the form key=value, where key is one of 'zero', 'low', 'printable', 'high' or 'all', and value is an SGR formatting string. SGR formatting is interpreted by your terminal emulator; consult its documentation or ECMA-48 for more details.
For example, the default formatting used when HEXD_COLORS is not defined corresponds to the value:
zero=38;5;238 low=38;5;150 high=38;5;141 all=38;5;167
π EXAMPLES π
Here are some examples of useful uses of hexd's features.
π« hexd -r0x1000+0x200 foo.bin
Display the 512-byte range in foo.bin starting at offset 0x1000. Useful when files contain other embedded files/formats at a certain location (e.g. archive files).
π¦ hexd -r-0x10 *.bin
Show the first 16 bytes of each of the *.bin files, with a heading above each file (if more than one). This is useful for example to compare headers of several samples of an unknown format.
πΈ curl -s http://example.com | hexd -P | less -R
hexd works as a filter, too. For paging long hexdumps, less(1)'s -R flag is useful.
π₯ SEE ALSO π₯
π AUTHORS π
Written by FireFly
mwah π this Debian edition is dated February 18, 2022 β go hexdump cute, bestie β slay π
π¦ where this page comes from
- nixos 26.05: hexd 1.1.0
- nixpkgs unstable: hexd 1.1.0
- opensuse-leap 16.0: hexd 1.1.0-bp160.1.12 Β· MIT
- opensuse-leap 16.0: hexd 1.1.0-bp160.1.12 Β· MIT
- opensuse-leap 16.0: hexd 1.1.0-bp160.1.12 Β· MIT
- opensuse-leap 16.0: hexd 1.1.0-bp160.1.12 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms