Joh*_*n T 356
它locate.updatedb
在 Mac 上。
须藤/usr/libexec/locate.updatedb
有关更多信息,请参见locate.updatedb 手册页。
小智 94
您可以执行此操作sudo ln -s /usr/libexec/locate.updatedb /usr/local/bin/updatedb
以使updatedb
命令可用。
小智 20
就个人而言,我刚刚安装了 findutils(使用 MacPorts 或 Homebrew)。
然后你有 GNU 定位和更新 b。
没有 sudo,updatedb 将无法工作。
我个人更喜欢每个用户都定位b;如果您 sudo 其他用户将知道您所有文件的名称/位置。
我有一个 cron 作业要运行:
updatedb --localpaths='/Users/grogs' --output='/Users/grogs/tmp/locatedb'
在我的 .zshrc .bashrc/.bashprofile 中:
export LOCATE_PATH="~/tmp/locatedb"
如果您在没有先更新数据库的情况下运行locate,您有机会通过其输出看到操作系统推荐的方式。
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.
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
124628 次 |
最近记录: |