Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
You need to use the command updatedb I'm pretty sure. Try man locate.updatedb – Rob Jan 18 '12 at 18:12
up vote 4 down vote accepted

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.

share|improve this answer
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 ;-)) – Feb 12 '15 at 16:03

You must log in to answer this question.

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