Can't add tag to apache config or log files
-
29-09-2020 - |
Question
In OS X X.9 Mavericks, I'd like to add a colored tag to my apache config file, which is under /private/etc/apache2, and to my apache log files, which are under /priavte/var/log
I do not have the option to add a colored tag to these files.
Is it because they are "hidden"? Or does it have to do with file ownership? Is there a workaround?
Solution
The files are owned by root and Finder runs as the user, so Finder is not allowed to modify the tags.
As a workaround, you can run Finder as root:
sudo /System/Library/CoreServices/Finder.app/Contents/MacOS/Finder
Or use tag or xattr:
brew install tag;sudo tag -s $'Red\n6' /etc/apache2/httpd.conf
sudo xattr -w com.apple.metadata:_kMDItemUserTags '("Red\n6")' /etc/apache2/httpd.conf;sudo xattr -wx com.apple.FinderInfo '00 00 00 00 00 00 00 00 00 0C 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' /etc/apache2/httpd.conf
OTHER TIPS
Lri answers my "why" question so I'll keep it as the accepted answer. But here is another workaround that seems to do the trick:
- Find the config or log files in Finder
- Right-click and choose Make Alias
- Tag the alias with your colored tag
- (?) I don't understand this step, but I had to move some of the aliases out of the restricted folder before they'd show up in the "tags" filter.