On 2/12/07, Gilboa Davara <[EMAIL PROTECTED]> wrote:
On Mon, 2007-02-12 at 15:56 +0200, Maxim Veksler wrote:
> Hi,
>
> Someone at work told me that doing "du -a <DIR>|grep <FILE>" is faster
> then "find <DIR>|grep <FILE>". I've measured, it doesn't looks quite
> so. It did OTOH got me wondering what's the quickest way to answer if
> file existed in a hierarchy of directories.

What about $ file -name <FILE> ?


Real situation: I've just done a major build which created 5th level
directories hierarchy (debug/Main/Engine/Simple/he). Now I wish to run
some quick shell test to see if anywhere inside all of this directory
jungle a file named libHelpTest.a was build.

Doing locate is no brainier because it's a major time waste on
updatedb (this directory is there only until the next scons
execution).

What I'm asking is for hacks to squeeze the last bit of performance
(just for fun) out of this simple file existence test. In the mean
time the find|grep pair seems to be the best performer in the balance
between (quick-to-type)/(fast-to-get-answer).

- Gilboa


Thanks,
Maxim.

--
Cheers,
Maxim Veksler

"Free as in Freedom" - Do u GNU ?

=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to