what is the difference between locate and find ?

kwhiskers kwhiskers at gmail.com
Tue Nov 8 17:54:47 UTC 2005


On 08/11/05, Matt Morgan <minxmertzmomo at gmail.com> wrote:
>
> On 11/8/05, Paul Howarth <paul at city-fan.org> wrote:
> > M E Fieu wrote:
> > > Hi.. I tried to look for a file in a linux box using both locate and
> find , when using find I can
> > > find my file but locate cannot. However I found sometime locate will
> work when I look for other
> > > file. what is the difference between locate and find ?
> > >
> > > [root at wa html]# locate abc.pl
> > > [root at wa html]# find / -name abc.pl -print
> > > find: /proc/21829/fd: No such file or directory
> > > /usr/local/abc/abc.pl
> > > [root at wa html]#
> >
> > locate uses a database that is refreshed periodically, whereas find does
> > a search on your live filesystem.
> >
> > So locate is likely to be faster, but find will be more up to date.
>
> /usr/bin/updatedb is the command that updates the slocate database
> that locate uses. You can make that happen nightly with a script in
> /etc/cron.daily, if it's not in there already.
>
> --
> fedora-list mailing list
> fedora-list at redhat.com
> To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
>

Curiously, it is expressly disabled in FC4 (why, is there something better?
What?). If you wish to use it, as I do, you have to edit /etc/updatedb.conf.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/fedora-list/attachments/20051108/f11a6c2e/attachment-0001.htm>


More information about the fedora-list mailing list