Xxd Command Not Found May 2026
If you're getting an "xxd: command not found" error, it usually means
the utility is either not installed or not in your system's PATH
is a staple for creating hex dumps, it is often bundled with other packages rather than being a standalone installation. Network World How to Install xxd
The package name often depends on your operating system or Linux distribution.
How to Fix "xxd command not found" in Linux and macOS Encountering the "xxd command not found" error can be frustrating, especially when you are trying to view binary files, perform hex dumps, or patch a file. This error simply means the xxd utility—a powerful tool usually bundled with the Vim editor—is missing from your system’s PATH.
Here is a quick guide on how to get xxd back on your machine, regardless of your operating system. What is xxd?
xxd is a command-line utility that creates a hex dump of a given file or standard input. It can also convert a hex dump back into its original binary form. While it is technically a standalone tool, it is almost always distributed as part of the Vim text editor package. How to Fix it on Linux
Most Linux distributions do not install xxd by default in their "minimal" versions. To fix this, you need to install the package that provides it. Ubuntu / Debian / Kali / Linux Mint
On Debian-based systems, xxd is often found in the xxd or vim-common package.
sudo apt update sudo apt install xxd # If the above fails, try: sudo apt install vim-common Use code with caution. CentOS / RHEL / Fedora / AlmaLinux
On Red Hat-based systems, you generally need the vim-common package. xxd command not found
sudo dnf install vim-common # Or for older versions: sudo yum install vim-common Use code with caution. Arch Linux
In Arch, xxd is included in the base vim package or as a standalone via xxd. sudo pacman -S xxd Use code with caution. How to Fix it on macOS
MacOS usually comes with xxd pre-installed as part of the system's Vim distribution. If you are seeing "command not found," your PATH might be broken, or you may be using a very stripped-down environment. The easiest fix is to install it via Homebrew: brew install vim Use code with caution.
This will install the latest version of Vim along with a fresh version of the xxd binary. Verifying the Installation
Once the installation is complete, verify that the command works by checking its version: xxd -v Use code with caution.
You should see output similar to xxd 2023-08-25 by Juergen Weigert. Common Alternatives to xxd
If you cannot install packages on your current system, you can often use these built-in alternatives to achieve similar results: hexdump: Usually available on almost all Unix-like systems. Usage: hexdump -C filename od (Octal Dump): A POSIX standard tool. Usage: od -t x1 filename
python: If you have Python installed, you can use a one-liner.
Usage: python3 -c "import sys; print(sys.stdin.read().hex())" < filename
The "xxd command not found" error is almost always solved by installing the vim-common or xxd package through your system's package manager. Once installed, you'll have full access to hex dumping and binary manipulation features. If you're getting an "xxd: command not found"
Are you trying to patch a specific binary or just inspect a file's contents using xxd?
Resolving the "xxd command not found" Error
The xxd command is a popular tool used for creating and parsing hexadecimal dumps. It's commonly used on Unix-like systems, including Linux and macOS. However, if you're encountering the "xxd command not found" error, it's likely because the xxd package is not installed on your system or not properly configured. In this article, we'll guide you through the steps to resolve this issue.
What is xxd?
xxd is a hexadecimal dump tool that can be used to create and parse hexadecimal representations of binary data. It's often used for:
- Creating hexadecimal dumps of files or data streams
- Parsing hexadecimal data and converting it back to binary
Causes of the "xxd command not found" Error
The "xxd command not found" error typically occurs when:
- The
xxdpackage is not installed on your system. - The
xxdpackage is not properly configured or installed. - You're using a minimal or customized Linux distribution that doesn't include
xxdby default.
Solutions to Resolve the "xxd command not found" Error
Verify installation
After installing, test with:
xxd --version
Permission Denied After Install
xxd should be executable by default. If not: Creating hexadecimal dumps of files or data streams
ls -l $(which xxd)
chmod +x $(which xxd)
macOS
Option 1 – Install Vim (includes xxd):
brew install vim
Option 2 – Install only xxd via MacPorts:
sudo port install xxd
Basic example of xxd in action
To see a hex dump of a file named example.bin:
xxd example.bin
To output only the first 32 bytes:
xxd -l 32 example.bin
To reverse a hex dump back to binary:
xxd -r hexdump.txt original.bin
Clearly, it’s a tool you’ll want ready when working at a low level.
Option 1: Git Bash (MinGW)
If you have Git for Windows installed, open Git Bash and run:
# Download the binary manually or use vim package
# Git Bash often includes vim which includes xxd
Check if vim is installed first:
vim --version
If not, install vim inside Git Bash’s environment.
Alpine Linux (common in Docker containers)
apk add vim
Solution B: Verify Installation and Path
If you believe Vim is already installed, verify the location of the binary.
- Check if
xxdexists in common directories:ls -l /usr/bin/xxd ls -l /usr/local/bin/xxd - Check your current PATH variable:
echo $PATH