4 Replies Latest reply: Nov 28, 2012 7:29 AM by wortell
bud_jones Level 1 (5 points)

I was playing around on the terminal using some Unix commands. When I tried "Locate" the system replied


WARNING: The locate database (/var/db/locate.database) does not exist.

To create the database, run the following command:



  sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.locate.plist



Please be aware that the database can take some time to generate; once

the database has been created, this message will no longer appear.


I have been using OSX for years and have never had occasion to use the Locate. Am I missing something useful?

MacBook, Mac OS X (10.7.3), AirPort Express, IPod, iPad, iPad2
  • Niel Level 10 (298,252 points)

    It's not created by default in Mac OS X 10.7. Generally, if all the drives you normally use are indexed by Spotlight, having a locate database won't add anything.



  • Barney-15E Level 8 (46,274 points)

    The locate database is only useful if you want to search for things in the command line. Locate isn't tied to spotlight or any other search functions on the Mac. It just indexes the programs on the hard drive so it can tell you where they are located if you ask.

  • bud_jones Level 1 (5 points)

    Thanks for the information. I didn't know if building the Locate database would help Spotight find files. Now I knowi can ignore Locate and live happily ever after.

    Bud Jones

  • wortell Level 1 (0 points)

    You probably already know this but I just found this very helpful as well - as I TOO was going to install the locate database, but didn't want to overdo it... - located at the bottom of the "http://support.apple.com/kb/HT2531" link - i noticed an advanced options section... (while in terminal you can use the power of command line of spotlight via the "mdfind {file/string}" command.


    I was jazzed as it was just as fast (slightly faster obviously due to no UI) as spotlight and gave me what I wanted.


    Jus' fyi is all. Hope it helps someone else too.