Solved

Finding files that contain certain text

Posted on 2006-11-06
2
235 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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Daily system administration tasks often require administrators to connect remote systems. But allowing these remote systems to accept passwords makes these systems vulnerable to the risk of brute-force password guessing attacks. Furthermore there ar…
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

856 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