HEXDUMP(1)

πŸ“¦ version 1.053, in alpine 3.24

🌸 HEXDUMP(1) β€” like, the hexdump manual page, bestie 🌸

okay so this is the hexdump page from the User Contributed Perl Documentation section, and before you ask β€” yes it's perl-adjacent, no it's not scary, sit down, I got you πŸ’–


✨ NAME ✨

hexdump β€” print input as hexadecimal. that's it, that's the whole gig. iconic behaviour honestly πŸŽ€


✨ SYNOPSIS ✨

hexdump [-bCcdovx] [-n NUMBER] [-s NUMBER] [file ...]

hexdump [-r] [file ...]

two whole modes, one little program. slay πŸ’…


✨ DESCRIPTION ✨

so here's the vibe: all the input files get smooshed together and treated as one single stream of data, and then it's formatted as hexadecimal. one stream. no cap 🌊

if you don't hand it any file arguments, it'll just use standard input β€” so pipe stuff in, it's fine, it's giving unbothered πŸ‘‘

and here's the cute part: duplicate lines of input are filtered by default. when it filters some, it prints a * character to let you know "yeah, one or more duplicate input lines happened here, I did not lose them, they're implied." 🫢

OPTIONS 🌈

the following options are available, and yes I'm listing every single one, don't test me:

  • -b β€” one-byte octal output. bytes, but make them octal.
  • -C β€” output canonical hex+ASCII. every line starts with an offset number, then a space-separated list of 16 hex bytes, and the printable input characters get listed between two | characters. this is the classic hexdump look, main character energy fr πŸ’–
  • -c β€” outputs a space-separated list of ASCII characters. non-print characters show up in octal, or as a C-escape code. silly little characters, but readable.
  • -d β€” format output as two-byte decimal.
  • -n NUMBER β€” terminate the process after reading a set NUMBER of input bytes. the number argument must be given in decimal (don't get creative). important: input that got skipped by the -s option is not counted toward this. πŸ™ˆ
  • -o β€” format output as two-byte octal.
  • -r β€” revert a hex dump back to binary, i.e. the un-hexdump πŸ¦‹ input is expected to be formatted as canonical hex+ASCII. the initial offset address and the ASCII suffix of each line are simply ignored. input lines may have zero or more hex bytes, and running over 16 bytes is supported. spaces between hex digits are ignored. an odd number of hex digits on a line results in an error β€” so keep your digits paired up bestie, it's not a suggestion 😭
also: setting -r causes all other options. (that's what the page says, I'm not making it up, don't shoot the messenger πŸ’€)

it is possible to specify multiple input files with this one, which is lowkey generous of it.

  • -s NUMBER β€” skip a set NUMBER of bytes at the beginning of input. the number argument must be given in decimal. and here's the cute detail: the offset number printed on output is advanced to reflect the skipped bytes β€” so the numbers still line up with reality, king behaviour πŸ‘‘
  • -v β€” duplicate lines of output are displayed. (remember the default? the * thing? this turns that off, you get everything, all of it, no filtering, good luck ⭐)
  • -x β€” format output as two-byte hexadecimal. this is the default ✨ so if you typed nothing and got two-byte hex, that's why, you're welcome.

πŸ’€ BUGS πŸ’€

there's no option for setting an output filename. none. zero. so if you run the -r option and don't redirect the output, it will straight up write binary data to your terminal. to your terminal. on purpose. by accident. either way, it's giving chaos πŸŒͺ️

redirect your output, bestie, I'm begging πŸ₯Ί

🫢 AUTHOR 🫢

written by Michael Mikonos. we love a named author, no mystery gremlins here πŸ’œ


Copyright (c) 2023 Michael Mikonos.

this code is licensed under the Artistic License 2. ✨


and that's the whole page!! πŸŒˆπŸ’–

cute little sign-off before you close the tab: this was perl v5.42.2, dated 2026-02-15 β€” so when you're citing your sources in the group chat, that's the version and the date to quote. bye bestie, go hexdump something responsibly πŸ’…πŸŽ€

πŸ“¦ where this page comes from