Monday, April 19, 2010

Print desired number of hexdump lines with xxd

$> xxd -l 0xN0 FILE
The command prints the first N hexdump lines (-l 0xN0) of the file (FILE).
The stuff works because each line of xxd output consists of 16=0x10 octets by default, so 0xN0 is the number of octets in the first N lines.

The other useful way to view binary file is the following: 
$> xxd FILE | less 

No comments:

Post a Comment