Spotlight



Spotlight is a fast, as-you-type system-wide search found in Mac OS X 10.4 and up. It is one of the biggest new features of Mac OS X 10.4 Tiger. It is important as it changes how the user interacts with files on the Mac. It is a significant alternative to the window file-organization system of the 1980s.

Uses
Using a metadata search engine, Spotlight finds almost anything on the computer, including documents, pictures, music, applications, System Preferences panes, as well as specific words in documents and PDFs. Searches can also be modified with date created, date modified, size, type and many more attributes.

Spotlight works with major input languages, including Western characters and East Asian ideogrammes.

Invoking Spotlight
The easiest way to invoke Spotlight is to use the Spotlight menu on the top-right hand corner of the Mac. Other ways to invoke it include using search fields.

Indexing
Spotlight builds a database of metadata keywords in documents on the user's hard drive. This initially takes place right after a successful installation of Mac OS X 10.4. Updates are made to this file continuously in the background with every file change on the drive.

Integration with Applications
Spotlight can be -- and is -- integrated into third-party applications in Mac OS X 10.4.

Spotlight settings
Spotlight can be configured in the Spotlight preference pane of System Preferences.

However, some things can't be configured. For example, Spotlight ignores files without extensions and ignores "." files even when Finder has been told not to.

Spotlight command line use
In Terminal, "mdfind stuff" is a simple way to find files containing 'stuff'. But mdfind can do much more:

mdfind 'kMDItemTextContent == "*Seneca*" && kMDItemContentType != "com.apple.mail.emlx"'

Use "mdls filesname" to see all the things Spotlight knows about a file.

Simple shell scripts:

"mygrep"

mdfind "kMDItemTextContent == '*$1*'"

"myfind"

mdfind "kMDItemFSName == '$1'"

Sources and References

 * Apple Spotlight