This deduplicates code between nncmpp and hex, while adding functionality.
2.0 KiB
hex(1)
Name
hex - Interpreting hex viewer
Synopsis
hex [OPTION]… [PATH]
Description
hex is a hex viewer that uses Lua scripts to interpret fields within files, colorizes them, and shows their descriptions on the side.
When run without arguments, it reads from its standard input stream.
Options
- -o, --offset OFFSET
-
Byte offset into the file. All preceding data will be ignored.
- -s, --size SIZE
-
Size limit in bytes. Any following data will be ignored.
The SIZE argument accepts similar suffixes as in dd(1): c=1, w=2, b=512, K=1024, KB=1000, M=1024K, MB=1000KB, G=1024M, and GB=1000M. The default value is 1G.
- -t, --type TYPE
-
Force interpretation as the given type, skipping autodetection. Pass in "list" for a listing of all available decoders.
- -d, --debug
-
Run in debug mode.
- -x, --x11
-
Use an X11 interface even when run from a terminal. Note that the application may be built with this feature disabled.
- -h, --help
-
Display a help message and exit.
- -V, --version
-
Output version information and exit.
Configuration
Create ~/.config/hex/hex.conf with contents like the following:
colors = { footer = "" footer_hl = "bold" bar = "reverse" bar_hl = "reverse bold" even = "" odd = "" selection = "reverse" }
Terminal attributes are accepted in a format similar to that of git-config(1), only named colours aren’t supported.
Files
hex follows the XDG Base Directory Specification.
- ~/.config/hex/hex.conf
-
The configuration file.
- ~/.local/share/hex/plugins/
- /usr/local/share/hex/plugins/
- /usr/share/hex/plugins/
-
Plugins are loaded from these directories, in order.
Reporting bugs
Use https://git.janouch.name/p/hex to report bugs, request features, or submit pull requests.