Basic Examples (8)
Search files in your current directory for the string "elephant":
Search on your current file system:
Search on all available file systems indexed by Spotlight:
Search for files that contain all the given words:
Search for files that contain one word but not another:
Search for files that were created or modified on a particular date:
Search for any folder that has "Library" in its name:
Search for music files by a particular artist:
Scope (6)
Use metadata attributes to find Wolfram notebooks at any level in the current directory:
Find notebooks that have "the" in their file name:
Find notebooks that have "the" in their file name and "elephant" in their text content:
Find movie files that are longer than 60 seconds:
Find PNG files that have an alpha channel and more than 5 million pixels:
Find files that have been changed in the last week:
Properties and Relations (4)
File lists can be analyzed in all the usual ways:
Import a random PNG image with an alpha channel:
Files found by Spotlight can be opened with SystemOpen:
FindList can be used to extract lines containing a given string:
Possible Issues (3)
Spotlight does not index files inside of .app bundles, such as your Wolfram System installation directory:
Spotlight can find matches in a file’s metadata, so a file’s contents may not contain the search string:
If quotes in your search string are not properly escaped, mdfind will give an error and return a nonzero exit code:
Neat Examples (4)
Learn about notebook-specific metadata keys and values with the mdls utility:
Use that metadata to find notebook files that have more than a thousand input cells:
Find notebooks that use a nondefault stylesheet:
Find palette notebooks:
Learn about metadata keys and values for any file of interest with the mdls utility:
Use that metadata to search for files with the same content type: