How can I delete everything in a folder that doesn't have a tag? Manually sifting through it is fairly unreasonable.

1 Answer 1

mdfind 'kMDItemUserTags!=*' -onlyin . -0|xargs -0 rm

Or using tag:

find . -type f|while read f;do [[ $(tag -m \* "$f") ]]||rm "$f";done

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.