LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   locate - Permission denied (https://www.linuxquestions.org/questions/linux-newbie-8/locate-permission-denied-443332/)

anjanesh 05-10-2006 01:44 AM

locate - Permission denied
 
I cant seem to use locate. I get this msg.
Code:

username@server [/]# locate mcrypt
warning: locate: could not open database: /var/lib/slocate/slocate.db: Permission denied
warning: You need to run the 'updatedb' command (as root) to create the database.
username@server [/]#

Any idea why ?

Thanks

nadroj 05-10-2006 01:45 AM

i assume you did you do what it says? ie run the specified command to create the initial search database

anjanesh 05-10-2006 01:55 AM

I need root access to run updatedb command ?

nadroj 05-10-2006 12:52 PM

yes you do.. since it would attempt modifying files where your normal user account doesnt (or shouldnt!) have access to.

give it a shot.

anjanesh 05-11-2006 12:58 AM

I did updatedb after I did su. Took time but worked. So how does this locate work ? Based on some cached results ? find doesnt seem to need and db - its just like windows dir.

spooon 05-11-2006 01:06 AM

locate searches through a database of file names (so it only knows of the things that exist as of the last update of the database); usually people have updatedb run automatically daily or something to update the databases. Searching through a text file is very quick, whereas traversing the entire directory tree (with find) is incredibly slow. I think Windows also has things where you can set a directory to be indexed periodically.


All times are GMT -5. The time now is 07:25 PM.