Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 2 Jun 2002 22:17:20 -0500
From:      Dan Nelson <dnelson@allantgroup.com>
To:        Peter Leftwich <Hostmaster@Video2Video.Com>
Cc:        FreeBSD Questions LIST <FreeBSD-Questions@FreeBSD.ORG>
Subject:   Re: find vs. `ls -alR | grep -i keyword`
Message-ID:  <20020603031720.GA94033@dan.emsphone.com>
In-Reply-To: <20020602184633.R787-100000@66-75-1-142.san.rr.com>
References:  <20020602184633.R787-100000@66-75-1-142.san.rr.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020603031720.GA94033>