Solved

how to make 'grep' only show file names

Posted on 2008-10-18
1
4,751 Views
Last Modified: 2013-12-06
Hi,

I would like only to have grep to echo the file name where the expression was found (i can do that with option -H), and not to show also the expression matched (that is what I don't know how to do)


Any help appreciated, thanks
0
Comment
Question by:siranm
1 Comment
 
LVL 26

Accepted Solution

by:
akahan earned 250 total points
ID: 22750994
Doesn't grep -l (lower case L) do that?

so for example

grep -l pattern *

would list the names of the files that contain pattern.

There are of course lots of different implementations of grep, but that works for the one I'm using.

0

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

Suggested Solutions

If you use Debian 6 Squeeze and you are tired of looking at the childish graphical GDM login screen that is used by default, here's an easy way to change it. If you've already tried to change it you've probably discovered that none of the old met…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

770 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