bash: Searching with ls Is there a bash command that can be used as Spotlight or an option with ls that only prints files containing certain text? I want to be able to open Terminal and type something ls -SOMEOPTION filename and find all the files that have filename in their name, and this option could be used with -R and it would work as a replacement for Spotlight.
find . -type f -name "*filename*" -exec grep -il 'mywordinthefile' {} \;



find search for file recursively in a directory. 
First parameters is the directory you want to look in. Here it's . so the current directory. You could use ~/Documents for example or any other directories. 
-type f- option is to only return files, not directories. 
-name option takes a pattern to find specifics filenames. 
grep is used here to find the word/pattern you want in the files found by find.