Home

zhangyiqun

Thoughts, stories and ideas.

Notes Blog Archives About
08 Jan 2011

在Mac上手动更新locate数据

Here’s one of those little things I do frequently, but never remember the command. The ‘locate’ command searches a file name database that is updated weekly (I think the default update time is 4:30 am every Saturday morning, but only if your Mac is switched on then, which mine never is). If you try to run ‘locate’ on a database that isn’t current, files created more recently than the last update will not be found, and deleted files will be found erroneously. To update the database manually use the following command:

sudo /usr/libexec/locate.updatedb

Notes Blog Archives About