Skip to content

Instantly share code, notes, and snippets.

@mathew-hall
Created February 16, 2015 11:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mathew-hall/d2e8edb8c69451849298 to your computer and use it in GitHub Desktop.
Save mathew-hall/d2e8edb8c69451849298 to your computer and use it in GitHub Desktop.
Generate a histogram of all hex bytes for a file
xxd -c 1 $1 | cut -d " " -f 2,3,4 | sort | uniq -c | perl -p -e 's/^\s+//; $_ =~ /(\d+)\s+([a-f\d]{2})\s+(.+)/; $_="$2 $3"."*"x$1."$1\n";'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment