How Do You Troubleshoot the Unexpected Output to a grep Command “Binary file (standard input) matches”?

Problem scenario
When grepping a file or output, you get "Binary file (standard input) matches". You only see a subportion of the matching strings. What should you do?

Solution
Use the -a flag. Here is an example:
cat foobar.txt | grep -a coolterm

Leave a comment

Your email address will not be published. Required fields are marked *