Skip to content

Linux hexdump Guide

Mattscreative edited this page Dec 5, 2025 · 2 revisions

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

  1. hexdump Basics
  2. Hexadecimal Dump
  3. Different Formats
  4. File Analysis
  5. Troubleshooting

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


This guide covers Arch Linux, CachyOS, and other Linux distributions. For distribution-specific details, refer to your distribution's documentation.

Clone this wiki locally