Solved

Finding files that contain certain text

Posted on 2006-11-06
2
234 Views
Last Modified: 2010-04-20
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
Comment
Question by:hankknight
  • 2
2 Comments
 
LVL 30

Expert Comment

by:Kerem ERSOY
ID: 17886218
Hi,

I guess

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

will do.
0
 
LVL 30

Accepted Solution

by:
Kerem ERSOY earned 500 total points
ID: 17886273
in fact grep with -l switch will do it too :) so.

grep -l -R myscript.cgi *

-l (Lima not India)
 
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Network Interface Card (NIC) bonding, also known as link aggregation, NIC teaming and trunking, is an important concept to understand and implement in any environment where high availability is of concern. Using this feature, a server administrator …
Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question