Thank you! I did use the syntax exactly as you mentioned and this is the result:
Thomas'MBP:Downloads entwicklung$ mdfind -onlyin ~/Downloads 'kMDItemTextContent == "Hannover" cd' *.pdf
/Users/entwicklung/Downloads/Billi/BilliProjekt/Resources/Tarife & Provider/WWW/Telefongesellschaften -- Telcos.htm
/Users/entwicklung/Downloads/Billi/Werbung/Adressen Computerzeitschriten.doc
/Users/entwicklung/Downloads/Billi/Werbung/Adressen Handyzeitschriften.doc
/Users/entwicklung/Downloads/Billi/CBProjekt/Resources/Tarife & Provider/WWW/Telefongesellschaften -- Telcos.htm
/Users/entwicklung/Downloads/aktienbrief567.pdf
/Users/entwicklung/Downloads/aktienbrief549.pdf
Thomas'MBP:Downloads entwicklung$
It finds the string Hannover in .pdf, .doc and .htm files and in subdirectories, too.
Any idea what I'm doing wrong?
VikingOSX wrote:
If you are passing this mdfind against PDFs that were scanned, and not OCRd, they are PDF wrappers around an image and the kMDItemTextContent cannot match text against an image.
That's ok. I know this.
Trying the same with another shell (zsh) I get these results:
entwicklung@Thomas'MBP / % mdfind -onlyin ~/Downloads 'kMDItemTextContent == "Hannover" cd' *.pdf
zsh: no matches found: *.pdf
entwicklung@Thomas'MBP / %
When I use the command
entwicklung@Thomas'MBP / % mdfind -onlyin ~/Downloads 'kMDItemTextContent == "Hannover" cd'
I get the same result as with bash.
I use Sonoma 14.2.1 on a MBP M1 13" and on an iMac Intel 27" with the same results.