From owner-freebsd-questions@FreeBSD.ORG Sat May 30 16:27:37 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 94FDB1065694 for ; Sat, 30 May 2009 16:27:37 +0000 (UTC) (envelope-from mel.flynn+fbsd.questions@mailing.thruhere.net) Received: from mailhub.rachie.is-a-geek.net (rachie.is-a-geek.net [66.230.99.27]) by mx1.freebsd.org (Postfix) with ESMTP id 4AD938FC1D for ; Sat, 30 May 2009 16:27:37 +0000 (UTC) (envelope-from mel.flynn+fbsd.questions@mailing.thruhere.net) Received: from sarevok.dnr.servegame.org (mailhub.rachie.is-a-geek.net [192.168.2.11]) by mailhub.rachie.is-a-geek.net (Postfix) with ESMTP id 094987E83F; Sat, 30 May 2009 08:27:36 -0800 (AKDT) From: Mel Flynn To: freebsd-questions@freebsd.org Date: Sat, 30 May 2009 18:27:34 +0200 User-Agent: KMail/1.11.3 (FreeBSD/8.0-CURRENT; KDE/4.2.3; i386; ; ) References: <200905301412.50958.mel.flynn+fbsd.questions@mailing.thruhere.net> <20090530171449.3719f9d6@gumby.homeunix.com> In-Reply-To: <20090530171449.3719f9d6@gumby.homeunix.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200905301827.34380.mel.flynn+fbsd.questions@mailing.thruhere.net> Cc: RW Subject: Re: find and searching for specific expression in files X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 May 2009 16:27:38 -0000 On Saturday 30 May 2009 18:14:49 RW wrote: > On Sat, 30 May 2009 14:12:50 +0200 > > Mel Flynn wrote: > > On Saturday 30 May 2009 13:56:22 Valentin Bud wrote: > > > 2009/5/30 Zbigniew Szalbot > > > > > > You can use egrep -r * (grep -e) to search for specific text > > > pattern while you are in a directory with many sub directories. The > > > output is nice because it tells you the file in which the text > > > pattern was found :). > > > > Discouraged because: > > - it's possible to hit maxarglen if the root directory has many > > subdirectories. > > - Will not search hidden directories in the root directory because of > > the shell glob > > You can replace "egrep -r *" with "egrep -r ." > i.e. recurse from the current directory, rather than search or recurse > on everything that matches *. That avoids the first two problems, and > most of the time the third doesn't matter OP (and myself) have a different concept of 'most of the time'. But this may be cause I'm already so used to this concept that my fingers have it store locally and I could've used grep -r or the overall win is minimal (I often use -name '*.h', and arguably in small trees it wouldn't matter). > > > - cannot be combined with other search criteria such as the file's > > timestamp. -- Mel