Last active
April 29, 2018 23:10
-
-
Save derickfay/5efeccab7d290252848ff6e84440c0be to your computer and use it in GitHub Desktop.
Search for files with a given tag in the current working directory only
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if [ "$#" -ne 1 ] | |
then | |
echo "Usage: lstag <tag>" | |
exit 1 | |
fi | |
mdfind "kMDItemUserTags == '*$1*'" -onlyin . | sort --ignore-case | grep $PWD | grep -v ^$PWD/.*/.*$ | sed 's!.*/!!' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment