HEXYL(1)
β¨ hexyl(1) β the terminal hex viewer that ATE π
okay bestie, so you know how sometimes you need to peek inside a file and see what's actually going on byte-by-byte? that's literally what hexyl does, and it's the manual page for it, and we're gonna get through it together. it's a command-line hex viewer (the NAME section said it, i'm just saying it louder π). no cap, this is the glow-up version of staring at raw bytes.
πΈ SYNOPSIS πΈ
hexyl [OPTIONS] [FILE]
that's the whole vibe. options and maybe a file, that's it. slay.
π¦ DESCRIPTION π¦
hexyl is a simple hex viewer for the terminal. it uses colored output to tell apart different categories of bytes β and yes, the color-coding is the whole main character energy here:
- NULL bytes
- printable ASCII characters
- ASCII whitespace characters
- other ASCII characters
- non-ASCII (the fancy ones π )
it's giving "i can read hex now" and honestly? iconic.
π POSITIONAL ARGUMENTS π
FILEβ the file you wanna display. if you don't give aFILEargument at all, it just reads fromSTDIN(so you can pipe stuff in, we love a flexible queen π«Ά).
β¨ OPTIONS β¨
get comfy, there's a bunch, but every single one is here, i promise.
-n,--length Nβ only readNbytes from the input. and bestie,Nis flexible: it can include a unit with a decimal prefix (kB,MB, ..) or a binary prefix (kiB,MiB, ..), or you can give it as a hex number. so many ways to say "just this much" π
Examples:
Read the first 64 bytes:
$ hexyl --length=64
Read the first 4 kibibytes:
$ hexyl --length=4KiB
Read the first 255 bytes (specified using a hex number):
$ hexyl --length=0xff
-c,--bytes Nβ literally just an alias for-n/--length. same energy, different letter.-l Nβ yet another alias for-n/--length. three names, one job, she's versatile πββοΈ-s,--skip Nβ skip the firstNbytes of the input.Ncan include a unit too (peep--lengthfor the deets). and plot twist: a negative value is valid and will seek from the end of the file. working backwards, we stan π--block-size SIZEβ sets the size of the block unit toSIZE(default is512). this is for when you're measuring in "blocks" and need to define how big a block is.
Examples:
Sets the block size to 1024 bytes:
$ hexyl --block-size=1024 --length=5block
Sets the block size to 4 kilobytes:
$ hexyl --block-size=4kB --length=2block
-v,--no-squeezingβ displays all input data. otherwise, any number of groups of output lines that would be identical to the preceding group of lines gets replaced with a line that's just a single asterisk (*). so it's squeezing out the repeats unless you say no π--color WHENβ when to use colors. auto-mode only displays colors if the output goes to an interactive terminal (so it knows when to flex and when to chill).
Possible values:
always(default)autonever
--border STYLEβ whether to draw a border with Unicode characters, ASCII characters, or none at all. pick your aesthetic π¨
Possible values:
unicode(default)asciinone
-o,--display-offset Nβ addNbytes to the displayed file position.Ncan include a unit (again, see--length). a negative value is valid and calculates an offset relative to the end of the file. offsets going both ways, she's fluid π-h,--helpβ prints help information. the classic "help me help you" move.-V,--versionβ prints version information. for when you gotta know which hexyl you're dealing with π
π ENVIRONMENT VARIABLES π
bestie. you can customize hexyl's colors via environment variables and it is so much fun. the variables used are as follows:
HEXYL_COLOR_ASCII_PRINTABLE: any non-whitespace printable ASCII characterHEXYL_COLOR_ASCII_WHITESPACE: whitespace such as space or newline (only visible in middle panel with byte values)HEXYL_COLOR_ASCII_OTHER: any other ASCII character (< 0x80) besides nullHEXYL_COLOR_NULL: the null byte (0x00)HEXYL_COLOR_NONASCII: any non-ASCII byte (> 0x7F)HEXYL_COLOR_OFFSET: the lefthand file offset
the colors can be any of the 8 standard terminal colors: black, blue, cyan, green, magenta, red, yellow and white. the "bright" variants are also supported (e.g., bright blue). and if you're feeling extra, you can use the RGB hex format, #abcdef. like, for example:
HEXYL_COLOR_ASCII_PRINTABLE=blue HEXYL_COLOR_ASCII_WHITESPACE="bright green" HEXYL_COLOR_ASCII_OTHER="#ff7f99"
look at that palette. a whole aesthetic. π
π₯ NOTES π₯
Source repository:
https://github.com/sharkdp/hexyl
(the plug is necessary, iykyk)
π EXAMPLES π
Print a given file:
$ hexyl small.png
Print and view a given file in the terminal pager:
$ hexyl big.png | less -r
Print the first 256 bytes of a given special file:
$ hexyl -n 256 /dev/urandom
three examples, all iconic, no notes. β¨
π AUTHORS π
hexyl was written by David Peter mail@david-peter.de. shoutout to the author, main character energy fr fr.
π REPORTING BUGS π
Bugs can be reported on GitHub at:
https://github.com/sharkdp/hexyl/issues
found a bug? don't be shy, report it, we love a proactive bestie π«Ά
π COPYRIGHT π
hexyl is dual-licensed under:
- Apache License 2.0 (
https://www.apache.org/licenses/LICENSE-2.0) - MIT License (
https://opensource.org/licenses/MIT)
dual-licensed? versatile, generous, we love to see it.
β SEE ALSO β
(go check those out too, the whole hex-viewer friend group is here)
okay that's the whole page, bestie. and for the sign-off: this is hexyl 0.12.0, dated 2022-12-05. go peek at some bytes, you're gonna slay ππΈπ¦
π¦ where this page comes from
- arch rolling: hexyl 0.17.0-2 Β· Apache-2.0 AND MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms