Skip to content

Instantly share code, notes, and snippets.

@ywss
Forked from davepeck/unused_images.sh
Created February 16, 2013 07:12
Show Gist options
  • Save ywss/4965916 to your computer and use it in GitHub Desktop.
Save ywss/4965916 to your computer and use it in GitHub Desktop.
#!/bin/sh
# Find PNG images not referenced by any xib, m/h, and plist files
# Works from current directory downward.
refs=`find . -name '*.xib' -o -name '*.[mh]' -o -name '*.plist'`
for image in `find . -name '*.png'`
do
image_basename=`basename $image`
image_name=${image_basename%.*}
if ! grep -q $image_name $refs; then
echo $image
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment