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.

Assuming I'm not interested in any information besides the answer if
file existing or not. I would only need to access the directory
listing and not the inode of each file, right? Is there some utility
that can do this very simple search efficiently?

real    0m8.445s
user    0m0.198s
sys     0m0.636s
[EMAIL PROTECTED] /]$ time find usr/


real    0m21.405s
user    0m0.332s
sys     0m1.524s
[EMAIL PROTECTED] /]$ time du -a usr/


real    0m9.228s
user    0m0.992s
sys     0m1.304s
[EMAIL PROTECTED] /]$ time ls -1R usr/


Thanks,

--
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