What commands do we have for finding tagged files/folders using find on the command line?

I have done a search and looked on this site and found nothing.

  • Yes - "tag" is one of those words that doesn't yield particularly relevant search results! You should put your GitHub find in an answer - more people will see it. – Seamus Aug 24 at 0:14

The correct command to perform Spotlight searches on the macOS Terminal command line is mdfind.

mdfind "kMDItemUserTags == '<your_tags_here>'"

The list all the kMD codes:

mdimport -A
| improve this answer | |
  • 2
    I marked your answer as accepted. There is a package on GitHub that also works. – John Aug 22 at 20:24
  • Nice find, very interesting. – James Brickley Aug 22 at 20:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .