Chapter 2. Searching and Metadata

If a Unix Geek needs to find something, she’ll probably use locate or find, depending on what she’s looking for. Because locate is based on a static database that’s only regenerated periodically (see "Scheduling Tasks in Chapter 4), it would be the choice for things that don’t change a lot (virtually anything in /usr). It’s also much faster because it has that database to consult. And trusty old find, slow as molasses, is what you need when you need more control over the search or when you’re looking for something that locate doesn’t know about, such as files that have been created recently.

But Tiger introduces a new search capability, Spotlight , which stores and sifts through file metadata faster than a herd of sheep can clear a field. Spotlight comes in two forms: a GUI interface accessible from the menubar, and a suite of command-line utilities. This chapter introduces you to Spotlight and shows you how to take advantage of all it has to offer.

Spotlight

Remember the relentless disk grinding you heard after you first installed the operating system? That was Spotlight creating its initial database. Spotlight is a repository of metadata for certain types of files—Spotlight gathers information about any file (or data record, such as an iCal event) for which it has an importer (an operating system plug-in that extracts metadata from a document). To see all the importers on your system, look in /System/Library/Spotlight and /Library/Spotlight.

By ...

Get Mac OS X Tiger for Unix Geeks, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.