2

I am running Arch Linux and have used the "locate" command quite often to find files. I noticed today, however, that it is bringing up results from where the item has been in the past, not it's current location. I have cleared the trash. I am wondering if there is a cache for locate that needs to be cleared as well. Any help would be appreciated. Thank you.

1
  • You need to use the command updatedb I'm pretty sure. Try man locate.updatedb
    – Rob
    Commented Jan 18, 2012 at 18:12

1 Answer 1

6

The cache for locate is updated by updatedb. On most distributions, it's run by cron every day or week. After huge changes, you can run it manually, too.

1
  • Complementing chorobas answer: do not forget to run it as root or sudo it. That is input in terminal: sudo updatedb Otherwise you will receive an error message similar to: updatedb: can not open a temporary file for '/var/lib/mlocate/mlocate.db' (I know it may sound obvious for a normal Linux user but I work under the conservative assumption of lowest experience level ;-)) Commented Feb 12, 2015 at 16:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .