Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages


home | help
HEXD(1)			FreeBSD	General	Commands Manual		       HEXD(1)

     hexd -- human-friendly hexdump tool

     hexd [-p] [-g groupsize] [-r range] [-w width] [file ...]

     hexd prints a human-readable hexdump of the specified files, or standard
     input if omitted.	Its main distinguishing	feature	is the use of colours
     to	visually indicate which	range of values	an octet belongs to, aiding in
     spotting patterns in binary data.

     The ranges	an octet is classified into are	zero (0x00), low (0x01..0x1F),
     printable (0x20..0x7E), high (0x7F..0xFE) and all (0xFF).

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

     -p	     Plain: disable colours/formatting.

     -g	groupsize
	     Number of octets per group, set to	8 by default.

     -r	range
	     Range of octets to	print from each	file.  Specified as either
	     start-end or start+count, where start and end/count are positive
	     integers specified	in either decimal, hexadecimal or octal	(C-
	     style notation).

	     When the former syntax is used, both ends of the range are	op-
	     tional 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	16 by default.

     HEXD_COLORS can be	used to	override the formatting	used by	hexd to	clas-
     sify octets.  If set, it should consist of	space-separated	pairs of the
     form key=value, where key is one of 'zero', 'low',	'printable', 'high' or
     'all', and	value is an SGR	formatting string.  SGR	formatting is inter-
     preted by your terminal emulator; consult its documentation or ECMA-48
     for more details.

     For example, the default formatting used when HEXD_COLORS is not defined
     corresponds to the	value

	   zero=38;5;238 low=38;5;150 high=38;5;141 all=38;5;167

     Here are some examples of useful uses of hexd's features.

     hexd -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).

     hexd -r-0x10 *.bin
	     Show the first 16 bytes of	each of	the *.bin files, with a	head-
	     ing above each file (if more than one).  This is useful for exam-
	     ple to compare headers of several samples of an unknown format.

     curl -s	| hexd | less -R
	     hexd works	as a filter, too.  For paging long hexdumps, less(1)'s
	     -R	flag is	useful.

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

     Written by	Jonas aFireFlya	HA<paragraph>glund.

FreeBSD	13.0		       October 11, 2016			  FreeBSD 13.0


Want to link to this manual page? Use this URL:

home | help