tmbinc / bgrep

Binary Grep
http://debugmo.de/2009/04/bgrep-a-binary-grep/
368 stars 57 forks source link

I'm terribly annoyed by the fact that grep(1) cannot look for binary strings. I'm even more annoyed by the fact that a simple search for "binary grep" doesn't yield a tool which could do that. So I wrote one.

Feel free to modify, branch, fork, improve. Re-licenses as BSD.

To install:

curl -L 'https://github.com/tmbinc/bgrep/raw/master/bgrep.c' | gcc -O2 -x c -o $HOME/.local/bin/bgrep -

usage:

bgrep [-B bytes] [-A bytes] [-C bytes] [ [...]]

-B: bytes_before -A: bytes_after -C: bytes_before and bytes_after