Finding files that contain certain text

Hello,

I use this:
       grep myscript.cgi * -R

to find ALL files in a directory / subdirectories that contain specific text.  It displays the
filename AND the line containing the text.

I JUST want it to display the filename ONLY.

Thanks!
LVL 16
hankknightAsked:
Who is Participating?
 
Kerem ERSOYConnect With a Mentor PresidentCommented:
in fact grep with -l switch will do it too :) so.

grep -l -R myscript.cgi *

-l (Lima not India)
 
0
 
Kerem ERSOYPresidentCommented:
Hi,

I guess

grep -H -R myscript.cgi * | cut -f1 -d:

will do.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.