Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have a file named Fubini's_theorem.html under some directory. But both

locate "Fubini's_theorem"

or

locate Fubini

do not return anything.

The file has been there for months, and I am sure it is already in the database used by locate. So I wonder why the search is not successful? Thanks!

My OS is Ubuntu 10.10.

share|improve this question
add comment

2 Answers 2

You could also use the find utility:

find / -name Fubini 2> /dev/null

/ to search starting from /
-name Fubini look for a file with "Fubini" in it's name
2> /dev/null redirect errors to /dev/null.

The redirect is useful when searching from root because /proc directories aren't really there. /proc is a virtual filesystem and finding through it is ... well just not right :)

share|improve this answer
add comment

You can use the following command to update the database of file indexes

/usr/bin/updatedb -e /mnt/data,/mnt/files,...

Theoretically this command should be in your crontab so that it's executed periodically. You could check your crontab by running

crontab -l

If it isn't in there you could add it manually.

share|improve this answer
    
@Tim: Have you checked in updatedb's config file, that you aren't limiting the search scope more than you think? .. /etc/updatedb.conf –  Peter.O Aug 22 '11 at 23:22
    
-e adds entries to PRUNEPATHS... This restricts the scope rather the expanding it. –  Peter.O Aug 22 '11 at 23:28
1  
Thanks! The file has been there for months, and newer files can be searched, so the database should be updated to have its record. Does my usage have any problem? @fred: The directory is already in PRUNEPATHS. –  Tim Aug 23 '11 at 1:23
    
@Tim.. The directory which contains your file should not be in PRUNEPATHS. . . PRUNEPATHS means "do not look in those paths" ... Also: It may, or may not, suit your situation, but on my personal desktop I always run sudo updatedb. (I use Ubuntu 10.04) –  Peter.O Aug 23 '11 at 8:09
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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