1. locate
- to enable it: sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.locate.plist
- to update it: sudo /usr/libexec/locate.updatedb
- database file: /var/db/locate.database
- database is supposed to update weekly at 3:15 AM on Saturdays. (http://hints.macworld.com/article.php?story=20111007011922833)
- it seems locate is actually using 'find' to build the database (http://osxdaily.com/2011/11/02/enable-and-use-the-locate-command-in-the-mac-os-x-terminal/)
- better alternative on Mac: mdfind (database for Spotlight)
-
- /System/Library/LaunchDaemons/ as com.apple.locate.plist and was supposed to launch at 3:15 AM on Saturdays
本文介绍了 MacOS 系统中 locate 命令的使用方法,包括如何启用、更新数据库及其工作原理。locate 使用 find 命令构建文件索引数据库,每周六凌晨 3:15 自动更新。此外,还推荐了 MacOS 下更高效的搜索替代方案 mdfind。

277

被折叠的 条评论
为什么被折叠?



