LinuxCommandLibrary

hexyl

Display file contents in hexadecimal format

TLDR

Print the hexadecimal representation of a file

$ hexyl [path/to/file]
copy

Print the hexadecimal representation of the first n bytes of a file
$ hexyl [[-n|--length]] [n] [path/to/file]
copy

Print bytes 512 through 1024 of a file
$ hexyl -r [512]:[1024] [path/to/file]
copy

Print 512 bytes starting at the 1024th byte
$ hexyl -r [1024]:+[512] [path/to/file]
copy

SYNOPSIS

hexyl [options] [file...]

PARAMETERS

-n
    Limit the output to the first bytes of the file.

-o
    Start reading the file from the specified offset (in bytes).

-s, --start-color
    Specifies the color of the start column.

-b, --byte-color
    Specifies the color of the bytes.

-i, --interpretation-color
    Specifies the color of the interpretation column.

-h, --help
    Display help message and exit.

-V, --version
    Display version information and exit.

DESCRIPTION

The hexyl command is a tool for displaying files in a hexadecimal format, similar to hexdump. It presents the file's contents in a human-readable form, showing both the hexadecimal representation of each byte and the corresponding ASCII characters (where possible). It's particularly useful for examining binary files, debugging software, or analyzing data formats that are not easily understood by simply viewing them as text.

hexyl aims for a visually appealing and user-friendly output. It highlights printable characters and uses color to differentiate sections, making it easier to scan and interpret the file's content. Compared to some other hex dump tools, hexyl prioritizes readability and usability.

CAVEATS

hexyl reads entire files into memory. Very large files could potentially cause memory issues. It's primarily designed for relatively smaller files that need to be analyzed visually.

COLORS

hexyl allows you to configure the colors used for different parts of the output to improve readability. You can specify colors using names like 'red', 'green', 'blue', 'cyan', 'magenta', 'yellow', 'black', 'white' or using hexadecimal color codes (e.g. '#RRGGBB'). Refer to the documentation for valid color names and formats.

SEE ALSO

hexdump(1), od(1), xxd(1)

Copied to clipboard