Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Click here to return to the 'Use Spotlight to speed up grep searches' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Use Spotlight to speed up grep searches
Authored by: mario_grgic on Mar 23, '10 06:24:20PM

I'm not sure this is all that useful. Usually when I search globally in spotlight I'm interested in wider array of file types (unless I know my file is say pdf then I restrict the search to kind:pdf etc).

But in terminal I'm usually not interested in pdf, doc files, presentations etc. I care about plain text files or code files. In that case find with xargs and grep is sufficient.

find command allows you to restrict your search to only files of certain type, files that were created/modified/accessed at certain date (range), it allows to recursively go into directories up to specified depth, skip certain files or directories etc. find search criteria alone can be quite complex (if it needs to be, usually it isn't), and then xargs and grep allow you to search inside files that passed through find filter. I find this always works for me and it's reasonably fast.

[ Reply to This | # ]