Solved

how to make 'grep' only show file names

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

This document is written for Red Hat Enterprise Linux AS release 4 and ORACLE 10g.  Earlier releases can be installed using this document as well however there are some additional steps for packages to be installed see Metalink. Disclaimer: I hav…
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…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

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