Linux xxd Guide - ryzendew/Linux-Tips-and-Tricks GitHub Wiki
Linux xxd Guide
Complete beginner-friendly guide to xxd on Linux, covering Arch Linux, CachyOS, and other distributions including hex dump, binary file editing, and data conversion.
Table of Contents
xxd Installation
Install xxd
Arch/CachyOS:
# Install vim (includes xxd)
sudo pacman -S vim
Debian/Ubuntu:
sudo apt install vim
Fedora:
sudo dnf install vim
xxd Basics
Hex Dump
Basic usage:
# Hexadecimal dump
xxd file.txt
# Shows file in hex format
Reverse
Convert back:
# Convert hex back to binary
xxd -r hex.txt > output.bin
# -r = reverse (converts hex to binary)
Hex Dump
Default Format
Hex output:
# Default hex format
xxd file.txt
# Shows:
# - Offset (hex)
# - Hexadecimal bytes (16 per line)
# - ASCII representation
Limit Length
Limit output:
# Limit length
xxd -l 100 file.txt
# -l = length (first 100 bytes)
Reverse Operation
Hex to Binary
Convert hex:
# Convert hex dump to binary
xxd -r hex.txt > output.bin
# -r = reverse (hex to binary)
Plain Hex
Plain format:
# Plain hex (no ASCII)
xxd -p file.txt
# -p = plain (hex only, no offset)
Troubleshooting
xxd Not Found
Check installation:
# Check xxd
which xxd
# Install vim if missing
sudo pacman -S vim
Summary
This guide covered xxd usage, hex dump, and binary file conversion for Arch Linux, CachyOS, and other distributions.
Next Steps
- hexdump Guide - Hex dump alternative
- od Guide - Octal dump
- file Guide - File type detection
- xxd Documentation:
man xxd
This guide covers Arch Linux, CachyOS, and other Linux distributions. For distribution-specific details, refer to your distribution's documentation.