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
>
I do it this way: 1) since there're too many files (~30k) to search thru, I generate the text file list daily for use via crontab using below command:
find /to/src/folder -type f -exec file {} \; | grep text | cut -d: -f1 > ~/.src_list &
2) create a function in .bashrc:
findex() {
cat ~/.src_list | xargs grep "$*" 2>/dev/null
}
Then I can use below command to do the search:
findex "needle text"
HTH:)