The hexyl utility is a modern, command-line hex viewer written in Rust that displays binary file structures with syntax-aware ANSI colour coding based on byte categories (NULL bytes, ASCII whitespace, printable characters, and control codes). When attempting to inspect binary files using hexyl in minimal Linux installations, container base images, or remote cloud servers, the shell returns bash: hexyl: command not found because the binary is not part of standard GNU core utilities.
Install hexyl via Pre-Compiled Static Binary
Deploying the standalone pre-compiled release binary is the fastest, cleanest approach for minimal systems without Rust build dependencies:
# Download latest hexyl archive for Linux x86_64
curl -sSL https://github.com/sharkdp/hexyl/releases/latest/download/hexyl-v0.14.0-x86_64-unknown-linux-musl.tar.gz -o /tmp/hexyl.tar.gz
# Extract binary directly into system binary directory
sudo tar -xzf /tmp/hexyl.tar.gz -C /usr/local/bin/ --strip-components=1
# Ensure executable execution permissions
sudo chmod +x /usr/local/bin/hexyl
# Remove temporary archive
rm -f /tmp/hexyl.tar.gz
# Verify installation
hexyl --version
Install via Linux Distribution Repositories
Most popular modern Linux package managers feature hexyl natively:
# On Debian or Ubuntu (20.04+):
sudo apt update && sudo apt install -y hexyl
# On Arch Linux:
sudo pacman -S hexyl
# On Alpine Linux:
apk add hexyl
# On systems with Homebrew:
brew install hexyl
Compile and Install via Cargo
If you have Rust and Cargo configured in your developer environment:
# Install hexyl via Cargo
cargo install hexyl
# Ensure ~/.cargo/bin is exported to PATH
echo 'export PATH="$HOME/.cargo/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc