$> grep -lir "main" *and that's it. So just call grep with -lir and the search string you're looking for, and in the files you're interested in (all files in the current directory in my case). The grep params are:
-l: outputs on the file name where the string occured
-i: ignore the case
-r: recursively look into all directories
Damn I love grep...