From owner-freebsd-questions Sun Jun 2 20:17:23 2002 Delivered-To: freebsd-questions@freebsd.org Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by hub.freebsd.org (Postfix) with ESMTP id D387137B403 for ; Sun, 2 Jun 2002 20:17:20 -0700 (PDT) Received: (from dan@localhost) by dan.emsphone.com (8.12.2/8.12.3) id g533HKge046683; Sun, 2 Jun 2002 22:17:20 -0500 (CDT) (envelope-from dan) Date: Sun, 2 Jun 2002 22:17:20 -0500 From: Dan Nelson To: Peter Leftwich Cc: FreeBSD Questions LIST Subject: Re: find vs. `ls -alR | grep -i keyword` Message-ID: <20020603031720.GA94033@dan.emsphone.com> References: <20020602184633.R787-100000@66-75-1-142.san.rr.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20020602184633.R787-100000@66-75-1-142.san.rr.com> User-Agent: Mutt/1.3.99i X-OS: FreeBSD 5.0-CURRENT X-message-flag: Outlook Error 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 In the last episode (Jun 02), Peter Leftwich said: > Does the "find" command run (usefully) faster than `ls -alR | grep -i > keyword` folks? "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. > Invariably, I surprise myself when a conglomeration such as `find /cdrw > -name "*deep\ water*" -print` actually prints useful information (i.e. a > hit)! Thoughts of "do I put a slash after cdrw" and "do I really > need the asterices or the backslash forcing the space" often confuse > this sysadmin for one. :) 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 dnelson@allantgroup.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message