I am looking at a file in my current directory (I'm root) called jungledisk..... When I do a locate *jungle*.* or *jungle* it produces no results.... what am I missing?

link|improve this question

Are you sure the locate database is getting updated in a timely fashion? Maybe it's configured to update weekly and the files simply aren't in the database yet? – larsks Dec 10 '10 at 20:28
feedback

3 Answers

up vote 4 down vote accepted

make sure you run

updatedb

first

link|improve this answer
Yep, that's it, thanks – Webnet Dec 10 '10 at 20:29
feedback

locate searches a database constructed by updatedb. you may need to rerun this command (or better yet, automate its running)

link|improve this answer
feedback

locate depends on a list filename database which is updated by the updatedb command. The database only reflects the filesystem at the time updatedb was run, so new files won't be found, and removed files will be.

You might want to add it to root's crontab. The entry below will run it at midnight, every night:

[root@localhost]$ crontab -e
0 0 * * * /usr/bin/updatedb
link|improve this answer
Depending upon the distribution, this command might also get it to run automatically, once per day: ln -s /usr/bin/updatedb /etc/cron.daily/updatedb although most distributions would automatically put an entry in there. – zerolagtime Dec 11 '10 at 18:28
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.