Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: Mark Sirota <msirota@isc.upenn.edu>
To: Jeff Shervey <jeff.shervey@us.landisstaefa.com>
Subject: Re: UNIX command to search subdirs for text in a file
Date: 1997/01/13	[thread overview]
Message-ID: <32DAD336.23F8@isc.upenn.edu> (raw)
In-Reply-To: 01bc018d$8f170bc0$17ee1bac@usbgrjeff


Jeff Shervey wrote:
> With DEC UNIX 3.2 how can I search a bunch of subdirectories for a
> certain file that contains certain text.
> I'm trying this command with no luck:
> 
> find . -name *.sql -print | grep -i "duplicate" *.pls

Close.  Try:
	find . -name \*.sql -print | xargs grep -i duplicate /dev/null

The /dev/null is to ensure that grep will tell you the filename.
Without it, if the last call to grep has only one file, you won't
know the filename.
-- 
Mark Sirota, Network Systems Engineer
University of Pennsylvania, Information Systems and Computing
msirota@isc.upenn.edu, 215/573-7214



  reply	other threads:[~1997-01-13  5:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-01-13  5:00 UNIX command to search subdirs for text in a file Jeff Shervey
1997-01-13  5:00 ` Mark Sirota [this message]
1997-01-14  5:00 ` Gleb O. Raiko
1997-01-14  5:00 ` Kenneth Miller
1997-01-14  5:00 ` Steve Strange USG
1997-01-14  5:00 ` Alan Rollow - Dr. File System's Home for Wayward Inodes.
1997-01-15  5:00 ` Juergen Fuhrmann
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox