Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I know if I run `updatedb` it would index all filesystem files. Sometimes, I install files into a directory and I want the new files to be in the database. I want a command such as `updatedb /opt/appdir` to update the new files information into the global database, not changing others. I consulted man but could not figure a way to update a single directory. Is it possible to do it?
I am using Fedora Core 3. I tried man updatedb, man locate/man slocate but none of them has the --localpaths info documented.
What's wrong with FC3?
And, I don't think `updatedb --localpaths=/opt/mozilla.org` works for me. It still takes several minutes to complete. /opt/mozilla.org has Firefox and Thunderbird installed. That does not need to take so long right?
Last edited by neo_in_matrix; 02-24-2005 at 08:00 AM.
I tried this on my homedirectory (33000 files) and it took appr. 30 s to complete.
Did you try it with ' around your path?
EDIT: here is the section from 'man updatedb':
Code:
OPTIONS
--localpaths='path1 path2...'
Non-network directories to put in the database.
Default is /.
--netpaths='path1 path2...'
Network (NFS, AFS, RFS, etc.) directories to put in
the database. The environment variable NETPATHS
also sets this value. Default is none.
--prunepaths='path1 path2...'
Directories to not put in the database, which would
otherwise be. The environment variable PRUNEPATHS
also sets this value. Default is /tmp /usr/tmp
/var/tmp /afs.
--prunefs='path...'
File systems to not put in the database, which
would otherwise be. Note that files are pruned
when a file system is reached; Any file system
mounted under an undesired file system will be
ignored. The environment variable PRUNEFS also
sets this value. Default is nfs NFS proc.
Your system is fine ... his distro doesn't use slocate
but the ordinary, security-hole infested version :} which
has a different set of options ... only downside: you
can't update an individual directory
Heh... yup, and that's exactly what I said: The problem
is not with your installation but with his. He uses the OLD,
insecure locate/updatedb rather than the NEW, secure
slocate. And I didn't say you can't run it ...
Learn the find utility because it is just as quick as the locate utility. Depending on the filesystem used. Searching for files should take less than a minute when using the find utility.
Sorry to hear about the 'old and insecure' version of locate in SuSE.
And also sorry for the previously provided wrong information: updatedb --localpaths='' will do the same as updatedb -U path: it creates a database from this path and replaces the previously existing database. It will not update the existing database with the specified path.
I was curious to find out more about the difference between locate and slocate. It seems that slocate will show only files the actual user has access to, whereas locate shows all data. I guess this doesn't matter on a single user system. Is there more to know?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.