After a few searches from Google, what I come up with is:
find my_folder -type f -exec grep -l \"needle text\" {} \\; -exec file {} \\; | grep text
Here's how I've done it ...
1 . make a small script to test if a file is plain text istext:
#!/bin/bash
[[ "$(file -bi $1)" == *"file"* ]]
2 . use find as before
find . -type f -exec istext {} \; -exec grep -nHi mystring {} \;
Although it is an old question, I think this info bellow will add to the quality of the answers here.
When ignoring files with the executable bit set, I just use this command:
find . ! -perm -111
To keep it from recursively enter into other directories:
find . -maxdepth 1 ! -perm -111
No need for pipes to mix lots of commands, just the powerful plain find command.
That said, I hope this is useful to anyone.
How about this
find . -type f|xargs grep "needle text"
grep eth0 $(find /etc/ -type f -exec file {} \; | egrep -i "text|ascii" | cut -d ':' -f1)