views:

57

answers:

1

I have large number of files with .gif extension. I would like to move all animated gifs to another directory. How can I do this using linux shell?

+2  A: 

Basically, if identify returns more than one line for a GIF, it's likely animated because it contains more than one image. You may get false positives, however.

Example use in shell:

for i in *.gif; do
  if [ `identify "$i" | wc -l` -gt 1 ] ; then
    echo move "$i"
  else
    echo dont move "$i"
  fi
done
Ivo