Hi,
locate -u will indeed set up an index. However, I do not think it will
use the same index location etc as the system generated index.
Further, I would have thought locate -u has to be run as root.
I suppose you could run locate with extra options to search only
your home directory, and write the results in your home directory.
on redhat 9, the daily cron job to update the db is
/etc/cron.daily/slocate.cron
You can run this as root.
=========================================================================
locate coupled with grep is a real improvement.
suppose you are looking for a binary file. Chances are, it is in a bin
directory.
locate xwd - 36 lines of output.
locate xwd | grep bin - just 3 lines of output.
Derek.
==============================================================================
On Thu, 18 Nov 2004, Nick Rout wrote:
>
> On Thu, 18 Nov 2004 09:28:39 +1300
> Steve Brorens <[EMAIL PROTECTED]> wrote:
>
> >
> > (following some discussion of how fast and useful the 'locate' command
> > is for finding files, and how 'updatedb' might need to be run to find
> > more recent files...)
> >
> > Personally I find it easier to remember:
> >
> > locate // finds files from the index
> > locate - u // refreshes the index (same as
> > 'updatedb')
> >
>
> personally I prefer to set it once in cron and let it do the remembering.
>
> I have never met a distro that does not set it up on a daily basis
> anyway. Although it can be a pain on a system that is not on 24/7,
> because most distros now use anacron as well, which takes care of
> running cron scripts that got left behind when the system was off.
> Therefore when you switch on you get all these cron processes happenning,
> including updatedb, which uses find on the whole hard drive, and rather
> makes the system appear slow.
>
> as i said to someone on another thread, serves you right for rebooting
> LOL.
>
>
> > _
> > Steve
> >
> > =========================================================
> >
> >
> > This e-mail has been scanned for Viruses and Content and cleared by CommArc
> > Cube Server
>
>
--
Derek Smithies Ph.D. This PC runs pine on linux for
email
IndraNet Technologies Ltd. If you find a virus apparently
from me, it has
Email: [EMAIL PROTECTED] forged the e-mail headers on
someone else's machine
ph +64 3 365 6485 Please do not notify me when
(apparently) receiving a
Web: http://www.indranet-technologies.com/ windows virus from me......