I want to find all text files containing source-code like class="some class"
. When using the Finder search, it is not working, seems like Finder is looking for "some class"
. Recommendations to other programs are welcome, too.
3 Answers
Try this in the Terminal:
grep -r 'class="some class"' .
You can replace that "." with any dirname you want, or a filename pattern like *.css
, etc.
I'd try EasyFind, freeware on the App Store. Can check inside packages & also use strict or fuzzy search. It's not massively fast, but it does get there.
-
I found this too, did not work for finding text inside files at all for me.– PwdrAug 11, 2014 at 17:07
I would try escaping the quotes with one or two backslashes:
class=\\"some class\\"
From the command line could be easier: http://support.apple.com/kb/TA25275
As in traditional BSD unix, the backslash character, "\", may be used before an illegal character to cause it to be parsed as part of the search string:
find / -name Mac\\ NC\\ # -print &