Date: Mon, 7 Apr 2003 15:04:01 +0100 From: Matthew Seaman <m.seaman@infracaninophile.co.uk> To: freebsd-questions@freebsd.org Subject: Re: searching insed(ide) files Message-ID: <20030407140401.GB51281@happy-idiot-talk.infracaninophi> In-Reply-To: <20030407140430.W10888-100000@gwdu60.gwdg.de> References: <200304071324.52494.a.carter@intrasoft.lu> <20030407140430.W10888-100000@gwdu60.gwdg.de>
next in thread | previous in thread | raw e-mail | index | archive | help
--V0207lvV8h4k8FAm Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Apr 07, 2003 at 02:06:26PM +0200, Konrad Heuer wrote: >=20 > On Mon, 7 Apr 2003, CARTER Anthony wrote: >=20 > > 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? >=20 > grep -c string file file ... | grep '1$' | sed 's/:.*$//' grep -l string filename...=20 does exactly what Anthony wants much more simply. Cheers, Matthew --=20 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 --V0207lvV8h4k8FAm Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (FreeBSD) iD8DBQE+kYVRdtESqEQa7a0RAqG4AJ96oU5jX2Tfr4DT7qV/jpNdLh7swwCdF+3k EuDaQYgq1SKT7g5q14pXbnc= =Skim -----END PGP SIGNATURE----- --V0207lvV8h4k8FAm--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030407140401.GB51281>