Macos Locate Fix And Alternative

find file
locate file
macos
tips
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.
Published

August 7, 2022


the fix

to enable the service:

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

to update locate db:

sudo /usr/libexec/locate.updatedb

or, more conveniently:

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

alternative

use mdfind