This article compares two methods for fixing and updating the locate command in MacOS. Comment A utilizes a launch daemon and terminal commands, while Comment B suggests repairing it using mdfind terminal commands.

the fix

to enable the service:

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

to update locate db:

1
2
sudo /usr/libexec/locate.updatedb

or, more conveniently:

1
2
3
sudo ln -s /usr/libexec/locate.updatedb /usr/local/sbin/updatedb
sudo updatedb

alternative

use mdfind

Comments