9

According to this article, I can use this command:

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

To enable "locate" command to find files. However, recently I find this command not useful anymore and want to shutdown the background service/daemon. Does anyone have ideas about how to disable it or shutdown it? Thanks!

1
  • 1
    For people visiting in the future, title is misleading, User wants to disable the background service populating the locate command's database. Not disable the locate command from running entirely. – jnovack Oct 2 '20 at 14:36
15

You can disable it like this:

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

Keep in mind, this process only runs periodically to make the database that caches the results, so your locate results will be static and not change from the time you unload the "refresh task".

6
  • Does that still work with SIP? – John Keates Feb 22 '18 at 1:33
  • @JohnKeates If launchctl could be used to load locate by Firegun, why would unloading it fail? – JAB Feb 22 '18 at 2:47
  • Well, if you change something in a SIP location on a pre-SIP macOS version and then upgrade, it gets locked in place – John Keates Feb 22 '18 at 8:58
  • Thanks! I'm using 10.13.3 and this command works for me. – Firegun Feb 23 '18 at 0:01
  • 1
    @RitobrotoGanguly Unloading just stops the regular update of the database used by locate, it doesn't disable the command as such. – nohillside Oct 2 '20 at 12:57

You must log in to answer this question.

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