From owner-freebsd-questions@FreeBSD.ORG Sat May 30 16:14:54 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 B7C181065670 for ; Sat, 30 May 2009 16:14:54 +0000 (UTC) (envelope-from rwmaillists@googlemail.com) Received: from mail-ew0-f212.google.com (mail-ew0-f212.google.com [209.85.219.212]) by mx1.freebsd.org (Postfix) with ESMTP id 3E4CF8FC1B for ; Sat, 30 May 2009 16:14:54 +0000 (UTC) (envelope-from rwmaillists@googlemail.com) Received: by ewy8 with SMTP id 8so3440129ewy.43 for ; Sat, 30 May 2009 09:14:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:subject :message-id:in-reply-to:references:x-mailer:mime-version :content-type:content-transfer-encoding; bh=2pJ1gJP+Yz+5JhJKsmni8oAvAdtDu7JeB3WKKe9oAIk=; b=vaofP8cwediFzJIBJMhDWuYr6iL2Q1jkUFMOjqfzY3FCf/0luRTvlmQHYnNSTpBMmx gQ09KgI3e7h/4i6j/xfcpIkRuxMfdvIrBKeANxLOt8/AaqadVDR5LCs0ldAQiHOMAA/F /tISgEhP7a6L7NW5M3KQwS7BqARJi9qb0/WVg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=date:from:to:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type:content-transfer-encoding; b=MO9p2alz6q9cOO4OPsjxSrwhzgVRySJFQerOwljIHKEAkJAsNKVR53/yH+OBkXMDE+ KkTSFp48USiT6nlBR4+qfN8oC5vGST+tsWr4UABD7FI3gSQD8ReyQwzbRBZDSDmokTOv bjXERPVgshA0bQi6GZoSY52njzotox9GdY+wg= Received: by 10.210.11.13 with SMTP id 13mr1671046ebk.8.1243700092847; Sat, 30 May 2009 09:14:52 -0700 (PDT) Received: from gumby.homeunix.com (bb-87-81-140-128.ukonline.co.uk [87.81.140.128]) by mx.google.com with ESMTPS id 5sm4585947eyf.28.2009.05.30.09.14.52 (version=SSLv3 cipher=RC4-MD5); Sat, 30 May 2009 09:14:52 -0700 (PDT) Date: Sat, 30 May 2009 17:14:49 +0100 From: RW To: freebsd-questions@freebsd.org Message-ID: <20090530171449.3719f9d6@gumby.homeunix.com> In-Reply-To: <200905301412.50958.mel.flynn+fbsd.questions@mailing.thruhere.net> References: <80cddf609e38046ffa0ce3f2bdab235c.squirrel@relay.lc-words.com> <139b44430905300456x62bf9c0ybf46bcab6b64e25@mail.gmail.com> <200905301412.50958.mel.flynn+fbsd.questions@mailing.thruhere.net> X-Mailer: Claws Mail 3.7.1 (GTK+ 2.16.1; i386-portbld-freebsd7.1) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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:14:55 -0000 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 > - cannot be combined with other search criteria such as the file's > timestamp.