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.
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.
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.
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.
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:
mdfind "kMDItemTextContent == '*$1*'"
mdfind "kMDItemFSName == '$1'"