Looking for a good portable linux system

Dan Jenkins dan at rastech.com
Wed Dec 22 09:44:00 EST 2004


Cole Tuininga wrote:
> On Wed, 2004-12-22 at 07:14 -0500, Travis Roy wrote:
> 
>>>  Or:
>>>
>>>	slocate -i mozilla
>>
>>or "find / | grep -i mozilla"
> 
> 
> Tell you what, we'll time the two and see which comes back quicker.  8)
> 

time locate 0047
    0.12user 0.03system 0:00.14elapsed
time find / |grep 0047
    0.42user 1.17system 2:52.24elapsed
time find / -name "0047*"
    0.37user 0.64system 1:51.99elapsed

140 milliseconds vs. almost 2 or 3 minutes

Of course, you need both tools. locate only helps
if it has already built the locate database. Recent
stuff still needs find. And, I usually have an idea
where to start finding something, so I don't need
to search the whole file system.

time find /var/www/html/joesalter -name "0047*"
    0.01user 0.04system 0:00.05elapsed

50 milliseconds vs. 140 milliseconds

So, which is quicker? ;-)

The answer, of course, is "it depends."

Anyways, *I* use both.

-- 
Dan Jenkins (dan at rastech.com)
Rastech Inc., Bedford, NH, USA --- 1-603-206-9951
*** Technical Support for over a Quarter Century



More information about the gnhlug-discuss mailing list