Mac Usage Tips

本文介绍了 MacOS 系统中 locate 命令的使用方法,包括如何启用、更新数据库及其工作原理。locate 使用 find 命令构建文件索引数据库,每周六凌晨 3:15 自动更新。此外,还推荐了 MacOS 下更高效的搜索替代方案 mdfind。

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值