From owner-freebsd-questions Wed Jun 5 20:11:22 2002 Delivered-To: freebsd-questions@freebsd.org Received: from russian-caravan.cloud9.net (russian-caravan.cloud9.net [168.100.1.4]) by hub.freebsd.org (Postfix) with ESMTP id 9650437B403 for ; Wed, 5 Jun 2002 20:11:20 -0700 (PDT) Received: from earl-grey.cloud9.net (earl-grey.cloud9.net [168.100.1.1]) by russian-caravan.cloud9.net (Postfix) with ESMTP id E314D28C7C; Wed, 5 Jun 2002 23:11:19 -0400 (EDT) Date: Wed, 5 Jun 2002 23:11:19 -0400 (EDT) From: Peter Leftwich X-X-Sender: To: Dan Nelson Cc: FreeBSD LIST Subject: Re: find vs. `ls -alR | grep -i keyword` In-Reply-To: <20020603031720.GA94033@dan.emsphone.com> Message-ID: <20020605230722.V45306-100000@earl-grey.cloud9.net> Organization: Video2Video Services - http://Www.Video2Video.Com MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Sun, 2 Jun 2002, Dan Nelson wrote: > "locate" beats them both (but works off a precomputed index). find will be faster, if only because it doesn't bother to print stats on every file only to get most of it suppressed by grep. It turns out my /var/db/locate.database file is 0 bytes and `man locate` doesn't exactly tell the use a good weight-gain formula for it... so I'll stick to beefing up my "find" command lines :) > > Invariably, I surprise myself when a conglomeration such as `find /cdrw -name "*deep\ water*" -print` actually prints useful information > no; you never need a slash after directories in any command, unless it's an output file and you want to tell the command to create it, and > no; because your argument is quoted. If you didn't quote it, you would have had to write \*deep\ water\* . > Dan Nelson Ah ha, learning is happening as I write this. However, how would you locate a file named '***dan_is_really_cool***' if your extension to my example holds true? i.e. I used -name "*deep\ water*" and you used \*deep\ water\* for yours. -- Peter Leftwich President & Founder Video2Video Services Box 13692, La Jolla, CA, 92039 USA +1-413-403-9555 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message