I have binary files that should be text (they're exported logs), but I can't open it with less (it looks ugly – it looks like a binary file). I found that I could open it with vi and I can cat it (you'll see the actual logs), but what I'd really like to do is grep through them (without having to open up each one with vi and then perform a search). Is there a way for me to do that?
How to grep through binary files that look like text
binarygrepparsingtext;
Best Answer
You can use
grep
anyway to search through the file - it does not really care if the input file is really text or not. From 'man grep':Please mark the words of caution at the end of the second paragraph. You might want to redirect the results from grep into a new file and examine this with vi / less.