From owner-freebsd-questions@FreeBSD.ORG Sun Apr 22 05:11:46 2007 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E689116A400 for ; Sun, 22 Apr 2007 05:11:46 +0000 (UTC) (envelope-from bill@ayn.mi.celestial.com) Received: from ayn.mi.celestial.com (hayek.celestial.com [192.136.111.12]) by mx1.freebsd.org (Postfix) with ESMTP id C553613C48A for ; Sun, 22 Apr 2007 05:11:46 +0000 (UTC) (envelope-from bill@ayn.mi.celestial.com) Received: from localhost (localhost [127.0.0.1]) by ayn.mi.celestial.com (Postfix) with ESMTP id 5D66968621E69; Sat, 21 Apr 2007 22:11:55 -0700 (PDT) X-Virus-Scanned: amavisd-new at mi.celestial.com Received: from ayn.mi.celestial.com ([127.0.0.1]) by localhost (ayn.mi.celestial.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id ePqhSHgLywrV; Sat, 21 Apr 2007 22:11:55 -0700 (PDT) Received: by ayn.mi.celestial.com (Postfix, from userid 203) id 3803768600414; Sat, 21 Apr 2007 22:11:55 -0700 (PDT) Date: Sat, 21 Apr 2007 22:11:55 -0700 From: Bill Campbell To: freebsd-questions@freebsd.org, Oliver Iberien Message-ID: <20070422051155.GA13501@ayn.mi.celestial.com> Mail-Followup-To: freebsd-questions@freebsd.org, Oliver Iberien References: <200704150923.25792.odilist@sonic.net> <996620.31871.qm@web58102.mail.re3.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <996620.31871.qm@web58102.mail.re3.yahoo.com> User-Agent: Mutt/1.5.11 OpenPKG/2.5 Cc: Subject: Re: Grep and --exclude? or, finding a text string that might be anywhere X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd@celestial.com List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Apr 2007 05:11:47 -0000 On Sat, Apr 21, 2007, L Goodwin wrote: >Oliver, the error is due to incorrect syntax ("-e" flag omitted). Try this: > >grep -R /usr -e "any2dvd" > >L Goodwin > >Oliver Iberien wrote: I need to find a reference to an obscure delete port that is in some file >somewhere (in /usr/ports/? somewhere in /usr?) as it is messing up make and, >among other things, preventing me from running the gnome upgrade script. So, >I do what little I know to do: > >grep -R /usr/* "any2dvd" > >This brings out a few valid discoveries (mostly in mailfiles when I posted >about this) and lots of "operation not supported" and "No such file or >directory" errors before grep spits out a "memory exhausted" error. If I >could at least stop it from looking at */tmp/* and ~/.kde it might have a >chance to get somewhere, but I can't figure out how --exclude >or --exclude-dir work, despite googling over and over for examples. Can this >be made to work? Or is there a better way? I generally use find, xargs, and grep for things like this: find /usr -type f | xargs grep -l 'any2dvd' OR find /usr -type f | egrep -v '/.kde|/tmp/' | xargs grep -l 'any2dvd' Bill -- INTERNET: bill@Celestial.COM Bill Campbell; Celestial Software LLC URL: http://www.celestial.com/ PO Box 820; 6641 E. Mercer Way FAX: (206) 232-9186 Mercer Island, WA 98040-0820; (206) 236-1676 ``If we got one-tenth of what was promised to us in these acceptance speeches there wouldn't be any inducement to go to heaven.'' Will Rogers