OS X Tip – Use Spotlight in the CLI

Posted by greg on Feb 17, 2008 in Macintosh |

Spotlight can be ran from the command line as well as from the GUI. Simply open a terminal window and type the command, mdfind followed by the search string.

For Example:

% mdfind greg

This would work just like the GUI, exempt it will echo its output to the terminal window. You can also pipe commands such as grep and search out specific information:

% mdfind greg | grep xls

This will display all the matches for greg and filter out only Excel spreadsheets.

Reply

Copyright © 2012 Greg Brown All rights reserved. Theme by Laptop Geek.