searching insed(ide) files

Matthew Seaman m.seaman at infracaninophile.co.uk
Mon Apr 7 07:04:08 PDT 2003


On Mon, Apr 07, 2003 at 02:06:26PM +0200, Konrad Heuer wrote:
> 
> On Mon, 7 Apr 2003, CARTER Anthony wrote:
> 
> > I am looking for a way to search inside a number of text files for a
> > particular string and return the name of the file if found. Any ideas?
> 
> grep -c string file file ... | grep '1$' | sed 's/:.*$//'

    grep -l string filename... 

does exactly what Anthony wants much more simply.

	Cheers,

	Matthew

-- 
Dr Matthew J Seaman MA, D.Phil.                       26 The Paddocks
                                                      Savill Way
PGP: http://www.infracaninophile.co.uk/pgpkey         Marlow
Tel: +44 1628 476614                                  Bucks., SL7 1TH UK
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20030407/a68942de/attachment.bin


More information about the freebsd-questions mailing list