-onlyin
option in mdfind searches a particular folder.
How do I exclude certain folders in combination with -onlyin?
Thus if I want to search the entire folder SearchHere containing folders A , B and C and exclude from searching within C.
-onlyin
option in mdfind searches a particular folder.
How do I exclude certain folders in combination with -onlyin?
Thus if I want to search the entire folder SearchHere containing folders A , B and C and exclude from searching within C.
You could use something like:
mdfind -onlyin SearchHere 'kMDItemFSName==ItemToSearch' | grep -v '/C/'
mdfind
seems to ignore kMDItemPath
, so using grep -v
should solve the issue.