hexyl README

The project's README from github.com/sharkdp/hexyl. As one markdown file: README.md.

CICD

hexyl is a hex viewer for the terminal. It uses a colored output to distinguish different categories of bytes (NULL bytes, printable ASCII characters, ASCII whitespace characters, other ASCII characters and non-ASCII).

Preview

Installation

On Ubuntu

... and other Debian-based Linux distributions.

If you run Ubuntu 19.10 (Eoan Ermine) or newer, you can install the officially maintained package:

sudo apt install hexyl

If you use an older version of Ubuntu, you can download the latest .deb package from the release page and install it via:

sudo dpkg -i hexyl_0.15.0_amd64.deb  # adapt version number and architecture

On Debian

If you run Debian Buster or newer, you can install the officially maintained Debian package:

sudo apt-get install hexyl

If you run an older version of Debian, see above for instructions on how to manually install hexyl.

On Fedora

If you run Fedora 35 or newer, you can install the officially maintained Fedora package:

sudo dnf install hexyl

On Arch Linux

You can install hexyl from the official package repository:

pacman -S hexyl

On Void Linux

xbps-install hexyl

On Gentoo Linux

Available in dm9pZCAq overlay

sudo eselect repository enable dm9pZCAq
sudo emerge --sync dm9pZCAq
sudo emerge sys-apps/hexyl::dm9pZCAq

On macOS

Via Homebrew:

brew install hexyl

...or via MacPorts:

sudo port install hexyl

On FreeBSD

pkg install hexyl

On NetBSD

pkgin install hexyl

On OpenBSD

doas pkg_add hexyl

on Termux

pkg install hexyl

or

apt install hexyl

Via Nix

nix-env -i hexyl

Via Guix

guix package -i hexyl

Or add the hexyl package in the list of packages to be installed in your system configuration (e.g., /etc/config.scm).

On other distributions

Check out the release page for binary builds.

On Windows

Check out the release page for binary builds. Alternatively, install from source via cargo, snap or scoop (see below). Make sure that you use a terminal that supports ANSI escape sequences (like ConHost v2 since Windows 10 1703 or Windows Terminal since Windows 10 1903).

Via cargo

If you have Rust 1.56 or higher, you can install hexyl from source via cargo:

cargo install hexyl

Alternatively, you can install hexyl directly from the repository by using:

git clone https://github.com/sharkdp/hexyl
cargo install --path ./hexyl

Note: To convert the man page, you will need Pandoc.

You can convert from Markdown by using (in the project root):

pandoc -s -f markdown -t man -o ./doc/hexyl.1 ./doc/hexyl.1.md

Via snap package

sudo snap install hexyl

Get it from the Snap Store

Via Scoop

scoop install hexyl

Via X-CMD

x env use hexyl

Configuration

hexyl colors can be configured via environment variables. The variables used are as follows:

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). Additionally, you can use the RGB hex format, #abcdef. For example, HEXYL_COLOR_ASCII_PRINTABLE=blue HEXYL_COLOR_ASCII_WHITESPACE="bright green" HEXYL_COLOR_ASCII_OTHER="#ff7f99".

License

Licensed under either of

at your option.

hexyl (sharkdp/hexyl)

Searching Database…

10.3K ·GitHub
这是什么?hexyl 是一个命令行十六进制查看器:它把文件的原始字节打印到终端里,并用不同颜色区分 NULL 字节、可打印 ASCII 字符、空白字符、其他 ASCII 字节和非 ASCII 字节。
那它是在终端里运行的——输出到底长什么样?它是一个纯终端工具,没有图形界面。输出是经典的十六进制转储——偏移量、十六进制值、可打印字符预览——每一类字节都有自己的颜色,文件的结构一眼就能看出来。
我需要先装 Rust 或其他依赖吗?日常使用完全不需要——软件包自带独立的可执行文件。只有用 cargo 安装这条路才需要工具链:Rust 1.56 或更高版本。
在 Windows 上有什么容易踩的坑吗?只有终端这一点:hexyl 的彩色输出需要支持 ANSI 转义序列,所以要用 ConHost v2(Windows 10 1703+)或 Windows Terminal(Windows 10 1903+)——老式控制台显示效果很差。
它在 macOS 和 Windows 上也能用吗,还是只支持 Linux?全都支持:主流 Linux 发行版、macOS、Windows、各 BSD 系统(FreeBSD、NetBSD、OpenBSD)都有软件包或可执行文件,甚至可以通过 Termux 在 Android 上运行。
我能改它给不同字节类型用的颜色吗?可以,通过环境变量:HEXYL_COLOR_ASCII_PRINTABLE、HEXYL_COLOR_ASCII_WHITESPACE、HEXYL_COLOR_ASCII_OTHER 和 HEXYL_COLOR_OFFSET 接受 8 种标准终端颜色、它们的亮色变体,或 RGB 十六进制值(如 #ff7f99)。
这些颜色到底能告诉我文件的什么信息?一眼看清文件的结构:大段连续的 NULL 字节(通常是填充)、可读的 ASCII 文本区域、空白字符、零星的 ASCII 控制字节以及非 ASCII 的二进制数据块,各自显示成不同的颜色。
什么时候我会需要这样一个十六进制查看器?只要你想看清一个二进制文件里到底装了什么——检查文件头、核对编码,或者找出可读文本在哪里结束、原始数据从哪里开始。hexyl 就是为这种字节级别的检查打造的。
What are similar projects?edit, fx, cobra, dust, homebrew-cask, spotify-tui, ripgrep, turbocrypt
Creator
sharkdp
Size
0.6 MB
Stars
10.3K
Age
7y
Commits · 90 Days