hexdump
file managementLinux/Unix
The hexdump command is one of the most frequently used commands in Linux/Unix-like operating systems. hexdump Display file contents in hexadecimal, decimal, octal, or ASCII
Quick Reference
Command Name:
hexdump
Category:
file management
Platform:
Linux/Unix
Basic Usage:
hexdump [options] [arguments]
Common Use Cases
Syntax
hexdump [options] file
Options
Option | Description |
---|---|
-b, --one-byte-octal |
One-byte octal display |
-c, --one-byte-char |
One-byte character display |
-C, --canonical |
Canonical hex+ASCII display (16 bytes per line) |
-d, --two-bytes-decimal |
Two-byte decimal display |
-e, --format=format |
Specify format string for displaying data |
-f, --format-file=file |
Specify file containing format strings |
-n, --length=length |
Interpret only length bytes of input |
-o, --two-bytes-octal |
Two-byte octal display |
-s, --skip=offset |
Skip offset bytes from the beginning |
-v, --no-squeezing |
Display all lines (don't omit duplicate lines) |
-x, --two-bytes-hex |
Two-byte hexadecimal display |
Examples
How to Use These Examples
The examples below show common ways to use the hexdump
command. Try them in your terminal to see the results. You can copy any example by clicking on the code block.
# Basic Examples Basic
hexdump file.bin