I use sudo /usr/libexec/locate.updatedb
on Mac OS X when I am too impatient to wait for it's scheduled script to kick in and run, which I believe is only once a month.
Mac OS X doesn't use cron/other schedulers, but instead ( at least pre Yosemite ), launchd is used, which is like cron
only more granular w/ more options, at the expense of a bit of over verbosity in my humble opinion.
Researching, I found this website which states that the below code is:
...In a moment of glorious chance, I happened to come across this handy little bash script and I nearly palmed my face clean off because I hadn't thought of it.
pushd . > /dev/null
cd /usr/libexec
echo "Updating locate database..."
sudo ./locate.updatedb
echo "Updating complete!"
popd > /dev/null
Can someone walk me though this, I have read the man page on each, but don't see the advantage. If you /usr/libexec before running ./locate.updatedb I fail to see why you would need the above script. It seems like a bit of overheard to manage another file, in your PATH, when you can just cd
into the executable and go from there.