[Solved] How to get file name which contains certain string?

Hi Gurus,

I need find which file contains certain string in one directory.
when using

cat * |grep

"string", I can get the string name but no file name displayed.
I am wondering if there is any option I can use to get which file contains this certain string.

Thanks in advance.

grep -l string *
1 Like
grep -l <string> *

Darn.. Missed by 5 minutes.... :wink:

1 Like

Thanks both of you. it works perfectly.