Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

audiomatt

macrumors member
Original poster
Dec 28, 2017
95
124
I'm aware that spotlight has all sorts of indexing that makes it really fast. Unfortuately this also seems to make it somewhat unrealiable on my machine. There can be something sitting in plain sight that just... it just doesn't find it. Sometimes the reason is obvious, for instance if the file is in an application package or it's sitting in some weird invisible folder but sometime's I find it inexplicable.

I'm looking for something that searches the old way. One file at a time. I'm a programmer so frequently I look for a command or variable in a folder full of .c or .py files. Spotlight really sucks at this. Is there a utility that will search the contents of files for text?

Any thoughts here? I'm assuming there's some commandline tool that harder core geeks use that I should learn.

sidenote: I'm still rocking mojave.
 
I'm aware that spotlight has all sorts of indexing that makes it really fast. Unfortuately this also seems to make it somewhat unrealiable on my machine. There can be something sitting in plain sight that just... it just doesn't find it. Sometimes the reason is obvious, for instance if the file is in an application package or it's sitting in some weird invisible folder but sometime's I find it inexplicable.

I'm looking for something that searches the old way. One file at a time. I'm a programmer so frequently I look for a command or variable in a folder full of .c or .py files. Spotlight really sucks at this. Is there a utility that will search the contents of files for text?

Any thoughts here? I'm assuming there's some commandline tool that harder core geeks use that I should learn.

sidenote: I'm still rocking mojave.
Easy Find! https://www.devontechnologies.com/apps/freeware
 
I'm aware that spotlight has all sorts of indexing that makes it really fast. Unfortuately this also seems to make it somewhat unrealiable on my machine. There can be something sitting in plain sight that just... it just doesn't find it. Sometimes the reason is obvious, for instance if the file is in an application package or it's sitting in some weird invisible folder but sometime's I find it inexplicable.

I'm looking for something that searches the old way. One file at a time. I'm a programmer so frequently I look for a command or variable in a folder full of .c or .py files. Spotlight really sucks at this. Is there a utility that will search the contents of files for text?

Any thoughts here? I'm assuming there's some commandline tool that harder core geeks use that I should learn.

sidenote: I'm still rocking mojave.
I use grep in a terminal window.
Code:
cd ~/some uesr file location
grep -iR "some text" *
The "i" flag indicates a case insensitive search, the "R" stands for recursive. The "*" says everything. If just want .py files, use *.py

DS
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.