Linux hexdump Guide - ryzendew/Linux-Tips-and-Tricks GitHub Wiki
Linux hexdump Guide
Complete beginner-friendly guide to hexdump on Linux, covering Arch Linux, CachyOS, and other distributions including hexadecimal dump, binary data inspection, and file analysis.
Table of Contents
hexdump Basics
Hex Dump
Basic usage:
# Hexadecimal dump
hexdump file.txt
# Shows file in hexadecimal format
Canonical Format
Canonical hex:
# Canonical format
hexdump -C file.txt
# -C = canonical (standard hex dump format)
Hexadecimal Dump
Default Format
Hex output:
# Default hex format
hexdump file.txt
# Shows:
# - Offset (hex)
# - Hexadecimal bytes
# - ASCII representation
Canonical Format
Standard format:
# Canonical format
hexdump -C file.txt
# Shows:
# - Offset
# - Hex bytes (16 per line)
# - ASCII representation
Different Formats
Decimal Offset
Decimal address:
# Decimal offset
hexdump -d file.txt
# -d = decimal (offset in decimal)
One-byte Format
Single bytes:
# One-byte format
hexdump -b file.txt
# -b = bytes (one-byte octal)
File Analysis
ASCII View
ASCII representation:
# ASCII view
hexdump -C file.txt
# -C shows ASCII on right side
Length Limit
Limit output:
# Limit length
hexdump -C -n 100 file.txt
# -n = length (first 100 bytes)
Troubleshooting
hexdump Not Found
Check installation:
# hexdump is part of util-linux
# Usually pre-installed
# Check hexdump
which hexdump
Summary
This guide covered hexdump usage, hexadecimal dump, and binary data analysis for Arch Linux, CachyOS, and other distributions.
Next Steps
- od Guide - Octal dump
- file Guide - File type detection
- stat Guide - File statistics
- hexdump Documentation:
man hexdump
This guide covers Arch Linux, CachyOS, and other Linux distributions. For distribution-specific details, refer to your distribution's documentation.