[vox-tech] Locate verses Find Was: resolving dependencies with XFree86-4.3.0-3

Rob Rogers vox-tech@lists.lugod.org
Thu, 10 Apr 2003 17:39:55 -0400


On Thu, Apr 10, 2003 at 16:19:52PM -0500, Jay Strauss wrote:
> What's really different about using locate than
> 
> cd /
> find . -name something* -print
> ???

locate uses a database that most distros have set to update (via the
command 'updatedb') nightly via cron. For searching a complete disk
locate is orders of magnitude faster...

I just ran a quick test on my system of 'locate /ctype.h' versus 'find /
-name ctype.h' ... locate took 0.170 seconds. find took 10.153.

Of course find is much more versatile (i.e. finding based on file
modification date and many more options) but for a quick name only
search, locate is usually much faster.