The locate database
December 17th, 2004 by admin
The MacOS X command line has a cool command, called locate, than can be useful when you’re trying to track down some strange unix file by its file name, say maybe you want to know where report.cls is located in your tetex installation, or some iraf source file.
The usage is merely locate filename but you have to have the locate database made first, and this is not done by default. You have to do this:
sudo /usr/libexec/locate.updatedb
Now you can type locate extern.pkg and behold the results. I imagine Tiger’s spotlight feature will blow this away in the 2nd quarter of 2005, but it’s still handy. You’ll really miss it on other UNIX systems once you get used to using it.
Update Actually, this post was all wrong until recently – the makewhatis command that was mentioned creates the database for man pages. So, you can do a man -k print and get all the unix command line programs that have to do with printing. Also, in Tiger, the locate and makewhatis databases should be updated automatically, via launchd, whether your computer is always on, or goes to sleep, etc. Still, you can use the locate.updatedb at any time, to update it to this very moment.
makewhatis, however is in /usr/libexec just like locate.updatedb