1

Since I upgraded grep from 2.16 to 2.21 it treats .properties-files like binary files. This sucks because I like to use grep -I ... to exclude binary files from the search results and .properties-files are clearly no binary files.

Is there a way to change that behavior?

1
  • Are these text files that you have created yourself? What is creating them? More explicitly: are you sure they don't have a binary header with some readable text? Commented Jan 8, 2015 at 14:16

1 Answer 1

1
grep --binary-files=text pattern file 

another solution :

strings -a file | grep pattern 
1
  • A note that running strings on untrusted files can make security vulnerable, see: lcamtuf.blogspot.com/2014/10/… Commented Jan 8, 2015 at 17:24

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.