Files

207 lines
4.9 KiB
Markdown
Raw Permalink Normal View History

2018-11-06 20:48:31 +01:00
![](doc/logo.svg)
2018-11-06 21:06:01 +01:00
2021-07-11 19:16:53 +02:00
[![CICD](https://github.com/sharkdp/hexyl/actions/workflows/CICD.yml/badge.svg)](https://github.com/sharkdp/hexyl/actions/workflows/CICD.yml)
2018-11-06 22:26:26 +01:00
[![](https://img.shields.io/crates/l/hexyl.svg?colorB=22ba4c)](https://crates.io/crates/hexyl)
![](https://img.shields.io/crates/v/hexyl.svg?colorB=00aa88)
2018-11-05 23:59:46 +01:00
2023-12-11 23:42:43 +01:00
`hexyl` is a hex viewer for the terminal. It uses a colored output to distinguish different categories
2018-11-06 21:34:46 +01:00
of bytes (NULL bytes, printable ASCII characters, ASCII whitespace characters, other ASCII characters and non-ASCII).
2018-11-06 21:19:00 +01:00
## Preview
![](https://i.imgur.com/MWO9uSL.png)
![](https://i.imgur.com/Dp7Wncz.png)
![](https://i.imgur.com/ln3TniI.png)
![](https://i.imgur.com/f8nm8g6.png)
2018-11-06 21:43:50 +01:00
2023-05-22 02:33:41 +01:00
2018-11-06 21:43:50 +01:00
## Installation
2020-03-09 21:05:26 +01:00
### On Ubuntu
*... and other Debian-based Linux distributions.*
2021-08-25 22:17:21 +02:00
If you run Ubuntu 19.10 (Eoan Ermine) or newer, you can install the [officially maintained package](https://packages.ubuntu.com/search?keywords=hexyl):
2020-03-09 21:05:26 +01:00
```bash
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:
2018-11-06 21:43:50 +01:00
``` bash
2024-10-29 22:17:12 +01:00
sudo dpkg -i hexyl_0.15.0_amd64.deb # adapt version number and architecture
2018-11-06 21:43:50 +01:00
```
2020-03-09 21:05:26 +01:00
### On Debian
2021-08-25 22:17:21 +02:00
If you run Debian Buster or newer, you can install the [officially maintained Debian package](https://packages.debian.org/search?searchon=names&keywords=hexyl):
2020-03-09 21:05:26 +01:00
```bash
sudo apt-get install hexyl
```
If you run an older version of Debian, see above for instructions on how to
manually install `hexyl`.
2022-06-23 12:33:12 -03:00
### On Fedora
If you run Fedora 35 or newer, you can install the [officially maintained Fedora package](https://packages.fedoraproject.org/pkgs/rust-hexyl/hexyl):
```bash
sudo dnf install hexyl
```
2018-11-08 19:56:06 +01:00
### On Arch Linux
2023-08-27 22:11:29 +03:00
You can install `hexyl` from [the official package repository](https://archlinux.org/packages/extra/x86_64/hexyl/):
2018-11-08 00:20:13 +08:00
```
2019-03-16 20:42:38 +01:00
pacman -S hexyl
2018-11-08 00:20:13 +08:00
```
2020-05-26 17:47:43 +00:00
### On Void Linux
2021-08-25 22:17:21 +02:00
2020-05-26 17:47:43 +00:00
```
xbps-install hexyl
```
2021-02-08 02:15:41 +02:00
### On Gentoo Linux
Available in [dm9pZCAq overlay](https://github.com/gentoo-mirror/dm9pZCAq)
```
sudo eselect repository enable dm9pZCAq
sudo emerge --sync dm9pZCAq
sudo emerge sys-apps/hexyl::dm9pZCAq
```
2019-01-07 11:34:37 +09:00
### On macOS
2021-06-07 04:03:22 -04:00
Via [Homebrew](https://brew.sh):
2019-01-07 11:34:37 +09:00
```
brew install hexyl
```
2018-11-08 00:20:13 +08:00
2021-06-07 04:03:22 -04:00
...or via [MacPorts](https://www.macports.org):
```
sudo port install hexyl
```
### On FreeBSD
```
pkg install hexyl
```
2023-09-11 08:35:32 +02:00
### On NetBSD
```
pkgin install hexyl
```
2023-08-06 20:39:31 +02:00
### On OpenBSD
```
2023-08-21 17:27:30 +02:00
doas pkg_add hexyl
2023-08-06 20:39:31 +02:00
```
2020-08-17 09:54:37 +08:00
### on Termux
```
pkg install hexyl
```
2021-08-27 21:36:56 +00:00
or
2020-08-17 09:54:37 +08:00
```
apt install hexyl
```
2019-01-14 13:19:02 -08:00
### Via Nix
```
nix-env -i hexyl
```
2020-11-19 18:56:35 +08:00
### 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`).
2018-11-12 08:40:05 +01:00
### On other distributions
2018-11-06 21:43:50 +01:00
Check out the [release page](https://github.com/sharkdp/hexyl/releases) for binary builds.
2019-01-10 08:32:46 +01:00
### On Windows
Check out the [release page](https://github.com/sharkdp/hexyl/releases) for binary builds.
2021-09-18 16:21:49 +08:00
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
2019-10-08 20:52:54 +02:00
or Windows Terminal since Windows 10 1903).
2019-01-10 08:32:46 +01:00
2018-11-06 21:43:50 +01:00
### Via cargo
2022-05-22 22:26:57 +02:00
If you have Rust 1.56 or higher, you can install `hexyl` from source via `cargo`:
2018-11-06 21:43:50 +01:00
```
cargo install hexyl
```
2022-03-24 01:42:10 +09:00
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](https://pandoc.org/).
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
```
2020-10-29 20:10:17 +05:30
### Via snap package
```
sudo snap install hexyl
```
2020-10-31 00:25:00 +05:30
[Get it from the Snap Store](https://snapcraft.io/hexyl)
2020-10-29 20:10:17 +05:30
2021-09-18 16:21:49 +08:00
### Via [Scoop](https://scoop.sh)
```
scoop install hexyl
```
### Via [X-CMD](https://x-cmd.com)
```
x env use hexyl
```
2021-09-18 16:21:49 +08:00
## Configuration
`hexyl` colors can be configured via environment variables. The variables used are as follows:
* `HEXYL_COLOR_ASCII_PRINTABLE`: Any non-whitespace printable ASCII character
* `HEXYL_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 null
* `HEXYL_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`). 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"`.
2018-11-06 21:43:50 +01:00
## License
Licensed under either of
2021-08-27 21:35:52 +00:00
* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or https://www.apache.org/licenses/LICENSE-2.0)
* MIT license ([LICENSE-MIT](LICENSE-MIT) or https://opensource.org/licenses/MIT)
2018-11-06 21:43:50 +01:00
at your option.