News, info, and opinion by Mac users, for Mac users.

December 6, 2006

tips

Use Spotlight from the Terminal

Posted Dec. 6, ’06, 3:30 PM PT by Collin Allen
Category | Tips

Spotlight mdfindHere’s a tip that actually makes Spotlight usable! You can avoid Spotlight’s eagerness to search for files by opening a Terminal windows and using the ‘mdfind’ command. With it, you can hunt for images with metadata containing “Mac OS X 10.5” instead of hunting for all kinds of documents containing “Ma”, as Spotlight usually starts running before you’ve even begun to type anything worth searching for. OS X Daily has the details on ‘mdfind’, which is nothing more than Apple’s own back-end to Spotlight.

It’s quite common in the open-source world to first build a command-line application, then attach a graphical interface on top of that, which is what Mac OS X is all about. Spotlight’s ‘mdfind’ command also has a number of filters, including the ability to search within specific folders and only on certain keys (like title, author, etc.), making it quite the robust little command-line utility, and one you’ll undoubtedly want to add to your Terminal skill set.


1 Comments

Larry V said:

Also, try out the mdls command to view metadata.

Leave a comment

 




Visit other IDG sites: