community man page

hexdump

Display file contents in hexadecimal, decimal, octal, or ASCII. Useful for inspecting dump file, binary data, or debug output. See also: `hexyl`, `od`, `xxd`.

9 examples·source: tldr · CC-BY·status: verified
Reading is open to everyone. Suggesting a flag, fixing an example or adding a recipe is opening to verified-email accounts soon — every change is moderated before it goes live.
curl https://curlhub.sh/man/hexdump
same page, in your terminal

Examples

Print the hexadecimal representation of a file, replacing duplicate lines by '*' GNU

hexdump path/to/file

Display the input offset in hexadecimal and its ASCII representation in two columns GNU

hexdump [-C|--canonical] path/to/file

Display the hexadecimal representation of a file, but interpret only n bytes of the input GNU

hexdump [-C|--canonical] [-n|--length] number_of_bytes path/to/file

Don't replace duplicate lines with '*' GNU

hexdump [-v|--no-squeezing] path/to/file

Print the hexadecimal representation of a file, replacing duplicate lines by `*`

hexdump path/to/file

Display the input offset in hexadecimal and its ASCII representation in two columns

hexdump -C path/to/file

Display the hexadecimal representation of a file, but interpret only a specific number of bytes of the input

hexdump -C -n number_of_bytes path/to/file

Verbose - no suppression by `*` on duplicate lines

hexdump -v path/to/file

Format output using printf-like format string

hexdump -e 'element_format .. end_format' path/to/file