Mac search no longer searching within files for text matches

findersearch

Good day, I recently noticed that my Mac is not searching inside files any more. If you notice, when you put in a search string at the search bar in Finder, Mac will also look up that string inside files it can read the text in (Word, Powerpoint, TextEdit files, even Java, PHP, C/C++ files — as long as the file can be read as text).

For example, if you look up "Hello World", it's going to look for all files containing in their filename and in their file content the string "Hello World" and show those files.

This is very handy because I can just search up a line of code I want to search and then all the files with that line of code will show up, I wouldn't have to check every file individually as it will get very tedious once the files in my code work reach 20+ files.

Does anyone know how to make Finder search within files again? I've tried resetting my laptop, as well as PRAM and SMC but to no avail.

Best Answer

grep command can do the same thing:

To find word "main" in all files(and directories) in the current working directory
In terminal: grep -r main *