commands
hexdump — Inspect binary bytes
Display binary content as offsets, hexadecimal bytes and printable characters. The canonical byte view is useful for identifying file headers; it does not decode file formats. Repeated identical lines may be compressed into an asterisk unless -v is used. Bound inspection with -n. No file is modified.
Formal Syntax & Structure
linux syntaxlinux
hexdump -C [-v] [-n LENGTH] [FILE ...]Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| -C | option | Canonical byte-oriented hexadecimal and character view |
| -v | option | Do not collapse repeated rows |
| -n LENGTH | option | Read at most LENGTH bytes |
| FILE | operand | Input file; omit to read standard input |
Return Value
exit status and output
Text on stdout; zero on success, nonzero on failure. Offsets are hexadecimal. Not a checksum.
Working Example
Example Snippetlinux
printf 'ABC' | hexdump -Cv