Solved

how to make 'grep' only show file names

Posted on 2008-10-18
1
4,743 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
Comment Utility
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Users are often faced with high disk consumption without really knowing where the largest amount of data resides. Disk Usage Analyzer (aka Baobab) is is a graphical, menu-driven application to analyse disk usage in any Gnome environment and can e…
1. Introduction As many people are interested in Linux but not as many are interested or knowledgeable (enough) to install Linux on their system, here is a safe way to try out Linux on your existing (Windows) system. The idea is that you insta…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

728 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now