has-tags icon indicating copy to clipboard operation
has-tags copied to clipboard

Command line utility for testing Mavericks tags

has-tags

has-tags is a small command line utility for OS X Mavericks that tests whether a file or folder matches a set of tags.

Installation

make
[sudo] make install

Usage

has-tags path tag [tag ...]

This tests that path has all of the given tags applied to it. The program will exit with code 0 if the path matches, or a non-zero code if it doesn't.

Only one path can be specified at a time. Each tag is case-sensitive.

Example

has-tags README.md Red && echo "This README is totes red"

To find all files matching a set of tags within a folder:

find . -exec has-tags {} Red Green Blue \; -print