The classic way I was taught was with a find -exec {} command:
find . -name "*.php" -exec grep -H "title phonetitle" {} \;
But, in reading the man page for grep, I see it has a -R option, for recursive. So, which is faster? Find or grep?
First, the classic find -exec command. I've suppressed the output from grep for clarity:
[buzzaboutwireless@ad cms]$ time find . -name "*.php" -exec grep -q "title phonetitle" {} \;
real 0m0.657s
user 0m0.182s
sys 0m0.487s
Now, for the recursive grep:
[buzzaboutwireless@ad cms]$ time grep -Rq "title phonetitle" .
real 0m0.251s
user 0m0.083s
sys 0m0.165s
Way faster. Neat. Less typing too.
Next: To prove black is white. I'll just remember to watch out for the zebra crossings.