For example, how do you search for all folders that contain ".mp3" files (on OS X)?
I don't think it's possible using Finder, but you can easily find these folders via Terminal
find . -name '*.mp3' | sed 's|/[^/]*$||' | sort -u
findlists all files (and their paths) ending in
mp3in the current folder and everything "beneath" it
sedstrips away the last part of each line produced by
findwhich does not contain a
/(which practically results in the file name getting removed)
- The result so far is a list of folders containing
mp3files. If a folder contains more than one such file, it will be listed several times so we use
sort -u(unique) to remove duplicates while sorting.