PIXD(1)

πŸ“¦ version 1.0.0, in nixos 26.05, nixpkgs unstable

πŸŽ€ NAME

okay so pixd β€” literally a colourful binary file visualizer. This is the pixd(1) page from the General Commands Manual, and bestie, it’s giving terminal rainbows πŸ’…πŸŒˆ.

✨ SYNOPSIS ✨

pixd [-r range] [-w width] [file ...]

πŸ¦‹ DESCRIPTION πŸ¦‹

pixd visualizes binary data by mapping each octet to a colour according to a palette, and it displays the octet at a given number of columns per line. It’ll process the files specified as arguments, or standard input if none are provided. No cap. πŸ’–

Heads up, bestie: pixd uses 24-bit colour SGR sequences and the U+2580 UPPER HALF BLOCK glyph for rendering. This means your terminal emulator needs to support both Unicode and 24-bit colour sequences β€” that’s the vibe check πŸ’….

The default palette maps the high nibble into a hue and the low nibble into a brightness value. The hues used are:

  • black (0x00)
  • red-orange (0x01..0x1F)
  • yellow (0x20..0x3F)
  • green (0x40..0x7F)
  • cyan-blue (0x80..0xBF)
  • purple-pink (0xC0..0xFE)
  • white (0xFF)

πŸ’… OPTIONS πŸ’…

If no file operands are specified, standard input is read instead. Available options are listed below.

  • -r range β€” range of octets to print from each file. You write it as either start-end or start+count, where start and end/count are positive integers specified in decimal, hexadecimal, or octal (C-style notation). With the start-end syntax, both ends of the range are optional and default to the start or end of the file when omitted.
  • -w width β€” number of octets per line, separated into groups (see -g). Set to 64 by default.

🧚 ENVIRONMENT 🧚

PIXD_COLORS can be used to override the colour palette. If set, it should consist of 256 whitespace-separated hex colours; each colour has to be exactly 6 hexadecimal digits representing a 24-bit colour (e.g. FFFF00 for yellow). So yeah, count those digits, bestie πŸ“.

🌈 EXAMPLES 🌈

Here are some examples of useful uses of hexd’s features (iykyk).

pixd -r0x1000+0x200 foo.bin

pixd -r0x1000+0x200 foo.bin

Display the 512-byte range in foo.bin starting at offset 0x1000. Useful when files contain other embedded files/formats at a certain location (e.g. archive files). Iconic for peeking inside stuff πŸ”₯.

pixd -r-0x400 *.bin

pixd -r-0x400 *.bin

Show the first 1024 bytes of each of the *.bin files, with a heading above each file (if more than one). This is useful for example to compare headers of several samples of an unknown format. Obsessed with a good header comparison 🫢.

curl -s http://example.com | pixd | less -R

curl -s http://example.com | pixd | less -R

pixd works as a filter, too. For paging, less(1)’s -R flag is useful. Filter queen behavior πŸ’œ.

πŸ‘‘ SEE ALSO πŸ‘‘

πŸŽ€ AUTHORS πŸŽ€

Written by Jonas β€˜FireFly’ HΓΆglund. Periodt. πŸ’–

🫢 and that’s the whole PIXD(1) page β€” source/version vibes: Debian, dated May 25, 2017. bye bestie, go make some binary rainbows πŸŒˆπŸ’…
πŸ“¦ where this page comes from