Skip to main content
added 30 characters in body
Source Link
Gilles Quénot
  • 36.7k
  • 7
  • 74
  • 97

What I would do:

grep -a -r -l -F <fixed string> .

-a, --text
Process a binary file as if it were text; this is equivalent to the --binary-files=text option.

or

find . -type f -exec stringssh {}-c +'
    strings "$1" | grep -FlF <fixed pattern>
' sh {} \;
 

strings - print the sequences of printable characters in files

What I would do:

grep -a -r -l -F <fixed string>

-a, --text
Process a binary file as if it were text; this is equivalent to the --binary-files=text option.

or

find . -type f -exec strings {} + | grep -F <fixed pattern>

strings - print the sequences of printable characters in files

What I would do:

grep -a -r -l -F <fixed string> .

-a, --text
Process a binary file as if it were text; this is equivalent to the --binary-files=text option.

or

find . -type f -exec sh -c '
    strings "$1" | grep -lF <fixed pattern>
' sh {} \;
 

strings - print the sequences of printable characters in files

Source Link
Gilles Quénot
  • 36.7k
  • 7
  • 74
  • 97

What I would do:

grep -a -r -l -F <fixed string>

-a, --text
Process a binary file as if it were text; this is equivalent to the --binary-files=text option.

or

find . -type f -exec strings {} + | grep -F <fixed pattern>

strings - print the sequences of printable characters in files