I have an app (gv) where I can run it from the terminal, but when I click on it, I get errors. This makes me think there are multiple instances of it or something. I tried which and got nothing... that seems odd. so then I tried locate, which gave me this warning:

$ which gv
$ locate gv

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 ran sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.locate.plist but when I run locate, I still get this message. yes, I can run find, but it is taking forever. How can I get locate working? I am on OSX 10.6.8

1 Answer 1


The launchd job can be run manually so you can see the progress.

Since locate runs find for you, that will also take forever, but perhaps you can inspect the progress or error condition the understand if the locate database is not getting built if you are patient:

time sudo /usr/libexec/locate.updatedb

While that runs, you could try spotlight as it likely has indexed that binary and can report back orders of magnitude faster than the options above:

mdfind "kMDItemFSName == 'gv'"
  • Also, on my MacBook with the 1.1 Ghz Core M processor that many are saying is too slow, the update command takes 2 seconds of wall time and one second of system time to execute. Unless you have a HDD with a very fragmented catalog file, it's odd for that command to take more than 5 minutes on most new hardware.
    – bmike
    May 26, 2015 at 15:03
  • Are you implying that mdfind queries the same cache as Spotlight?
    – deed02392
    May 29, 2019 at 21:14
  • Yes @deed02392 the metadata subsystem and utilities fuel the spotlight graphical function. There is one database that caches the results of filesystem content and activity (steady state, the index updates itself as part of the process that writes data to the filesystem).
    – bmike
    May 29, 2019 at 22:24
  • 1
    Fantastic! Seems like mdfind is a better idea than locate. Even after manually updating locates db it did not find files that mdfind did.
    – deed02392
    May 29, 2019 at 22:38

You must log in to answer this question.

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