List all tags in Terminal in Mavericks?
The tags name are in ~/Library/Preferences/com.apple.finder.list
.
You can read it with
defaults read com.apple.finder.plist ViewSettingsDictionary
It will need some parsing to be a bit clearer :
defaults read com.apple.finder.plist ViewSettingsDictionary |
awk 'NR%12==2'| grep -o '".*"' | sed 's/^.\(.*\).\{18\}$/\1/'
Other possibility is parsing the plist as xml. To do that you'll need to first convert the plist from binary to xml using.
plutil -convert xml1 ~/Library/Preferences/com.apple.finder.plist
You can also use tag:
tag -tgf \*|grep '^ '|cut -c5-|sort -u
tag -f \*
finds all files with tags, -t
includes tag names in the output, and -g
prints each tag on a separate line.