macOS locateコマンドを利用可能にする方法
環境
macOS
1.locateコマンドを実行します
実行結果
% locate filename
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.
2.解決方法
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.locate.plist
sudo /usr/libexec/locate.updatedb
3.再度locateを実行します
locate filename