linux - How to grep for presence of specific hex bytes in files? -
my web app displaying bizarro output (unicode characters shouldn't there, etc.). best can reckon somehow introduced bad char somewhere in source, can't figure out where.
i found this answer states can like:
grep -obuap "<\x-hex pattern>" .
when copy unicode char out of browser , bless hex editor, tells me exact bytes of char are:
15 03 01 ef bf bd 02 02
how can format <\xhex pattern>
match exact bytes need. tried:
grep -obuap "<\x-15 03 01 ef bf bd 02 02>" .
but doesn't work. thoughts?
check post again. frost not including '<' , '>' in actual grep command. used carats enclose example statement. actual statement looks this:
"\x01\x02"
not:
"<\x01\x02>"
i have c source file on computer begins line:
#include <stdio.h>
when run
grep -obuap '\x69\x6e\x63\x6c\x75\x64\x65' io.c
i get
1:include
that is, line number followed only string matching pattern.
you may want run
man grep
and find out options mean.
Comments
Post a Comment