How do I show filenames only after a keyword grep search?
The -l argument should do what you want.
-l, --files-with-matches
Suppress normal output; instead print the name of each input
file from which output would normally have been printed. The
scanning will stop on the first match. (-l is specified by
POSIX.)
You can use xargs in combination with --null with grep or --print0 with ack. I find that ack speed is faster.
grep -lr --null searchterm * | xargs -I {} -0 echo {}
ack -lr --print0 searchterm * | xargs -I {} -0 echo {}