Skip to content

Instantly share code, notes, and snippets.

@amarcadet
Forked from davepeck/unused_images.sh
Created January 29, 2013 13:33
Show Gist options
  • Save amarcadet/4664272 to your computer and use it in GitHub Desktop.
Save amarcadet/4664272 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