[TriLUG] find(1) vs locate(1) (was: Ignoring certain DHCP options (specifically, DNS))
Kevin Kreamer
kevin at kreamer.org
Tue Feb 19 19:50:14 EST 2013
On Feb 19, 2013 10:42 AM, "Paul Bennett" <paul.w.bennett at gmail.com> wrote:
>
> On Feb 19, 2013 10:34 AM, "Brian Henning" <bhenning at pineinst.com> wrote:
> >
> > Is find(1) more thorough than locate(1) (presuming a recent
updatedb(8))?
>
> Not better or worse, but different. There are very many more options to
> find(1), to where it essentially is a full query language for the entire
> filesystem. On the other hand, locate(1) can't be beaten for just locating
> files by name.
The other major difference is that find looks at filesystem when you run
the command while locate builds a database overnight. The benefit from
locate's approach is that it is faster, but the downside is that the
results can be wrong if you've recently added files, you've recently
deleted files, or if the cron job had an issue with (or simply missed)
building the database.
Kevin
More information about the TriLUG
mailing list