Created
June 5, 2017 06:50
-
-
Save bitmess/e2e5bb6cbf50dc3a8793cf098eb88793 to your computer and use it in GitHub Desktop.
find unused pics
This file contains 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
#!/bin/sh | |
for i in `find . \( -path '*/Library' -o -path '*/Pods' \) -a -prune -o -name '*.jpg' -o -name '*.png' -print`; do | |
file=`basename -s .jpg "$i" | xargs basename -s .png | xargs basename -s @2x` | |
result=`ag -i "$file"` | |
if [ -z "$result" ]; then | |
echo "$i" | |
# 如果需要,可以直接执行删除: | |
# rm "$i" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment