mdfind: Combining kMDItemTextContent & kMDItemContentType
I'm trying to use the Terminal command mdfind to search my file system for text file .rtf containing a certain pattern as in the following example:
mdfind -onlyin '/Volumes/TO Video/Youtube Opere' 'kMDItemTextContent == "Sierra"' && 'kMDItemContentType == "*.rtf"'
This does NOT work: it returns "zsh: no matches found"
But both the following return results as expected!:
a. mdfind -onlyin '/Volumes/TO Video/Youtube Opere' 'kMDItemTextContent == "Sierra"'
returns all files in the folder (even .pdf) containing "Sierra", and most of them are .rtf
b. mdfind -onlyin '/Volumes/TO Video/Youtube Opere' 'kMDItemContentType == "*.rtf"'
returns all .rtf files the folder, no matter what they contain
So I guess I miss something in the mdfind syntax!
May I use "||" or "&&" in a query ? according to (OLD?) description of mdfind they are supposed to work...
Can anybody help me?
Thanks!
Piero