Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Finding files that contain certain text

Posted on 2006-11-06
2
Medium Priority
?
241 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 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 does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Fine Tune your automatic Updates for Ubuntu / Debian
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Suggested Courses

618 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