
如何刪除沒有標籤的資料夾中的所有內容?手動篩選它是相當不合理的。
答案1
mdfind 'kMDItemUserTags!=*' -onlyin . -0|xargs -0 rm
或使用標籤:
find . -type f|while read f;do [[ $(tag -m \* "$f") ]]||rm "$f";done
如何刪除沒有標籤的資料夾中的所有內容?手動篩選它是相當不合理的。
mdfind 'kMDItemUserTags!=*' -onlyin . -0|xargs -0 rm
或使用標籤:
find . -type f|while read f;do [[ $(tag -m \* "$f") ]]||rm "$f";done