• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 242
  • Last Modified:

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!
0
hankknight
Asked:
hankknight
  • 2
1 Solution
 
Kerem ERSOYPresidentCommented:
Hi,

I guess

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

will do.
0
 
Kerem ERSOYPresidentCommented:
in fact grep with -l switch will do it too :) so.

grep -l -R myscript.cgi *

-l (Lima not India)
 
0

Featured Post

Restore individual SQL databases with ease

Veeam Explorer for Microsoft SQL Server delivers an easy-to-use, wizard-driven interface for restoring your databases from a backup. No expert SQL background required. Web interface provides a complete view of all available SQL databases to simplify the recovery of lost database

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now