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

NameTypeDescription
-CoptionCanonical byte-oriented hexadecimal and character view
-voptionDo not collapse repeated rows
-n LENGTHoptionRead at most LENGTH bytes
FILEoperandInput 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
Linux Reference