On Mon, Feb 21, 2011 at 04:54:40PM +0100, Alexander Schrijver wrote: > On Mon, Feb 21, 2011 at 01:34:51PM +0100, Pascal Stumpf wrote: > grep(1) only prints the filename when it receives more then 1 filename as > arguments. Thus, when you do this: > > $ find . -name '*.c' -exec grep bla {} \; > > It doesn't print the filename.
grep will always print the filename if you specify the -R flag. It's more of a side effect, though. Also, you'd probably want to specify '-type f' to avoid recursing through a directory. $ find . -type f -name '*.c' -exec grep -R blah {} \;