Skip to content

Instantly share code, notes, and snippets.

@neovov
Created April 12, 2013 15:06
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save neovov/5372700 to your computer and use it in GitHub Desktop.
Save neovov/5372700 to your computer and use it in GitHub Desktop.
Some command lines to use Spotlight and find some files
# Display file's metadata
$ mdls <file>
# Firefox (but not Aurora)
$ mdfind "kMDItemKind == 'Application' && kMDItemDisplayName == '*Firefox*'"
# Firefox Aurora
$ mdfind "kMDItemKind == 'Application' && kMDItemDisplayName == '*Aurora*'"
# Chrome & Chrome Canary
$ mdfind "kMDItemKind == 'Application' && kMDItemDisplayName == '*Chrome*'"
# Safari
$ mdfind "kMDItemKind == 'Application' && kMDItemDisplayName == '*Safari*'"
# WebKit (beware, case sensitive & might find unwanted results if we use a wildcard at the end)
$ mdfind "kMDItemKind == 'Application' && kMDItemDisplayName == '*WebKit'"
# Opera & Opera Next
$ mdfind "kMDItemKind == 'Application' && kMDItemDisplayName == '*Opera*'"
# Xcode (cannot find iOS Simulator since it is bundled in Xcode and Spotlight doesn't index)
$ mdfind "kMDItemKind == 'Application' && kMDItemDisplayName == '*Xcode*'"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment