I don't know why you want them to be 777. It should be 666, just like the graemlins and post icons. Anyhow, the command you need is:
chmod 666 avatars/*.gif
or just
chmod 666 avatars/*
You can replace 666 w/ 777 if you really need the files to be executable, which I doubt
EDIT:
Here's a couple commands I use to set permissions quickly:
chmod 666 stylesheets/*.css includes/*.php filters/* languages/*/*.php images/icons/*.gif images/graemlins/*.gif images/avatars/*.gif theme.inc.php
&
chmod 777 includes/ stylesheets/ images/icons/ images/graemlins images/avatars/
Did I miss any? BTW: Those were just TWO commands, albeit long. Very useful however, and using the command line completion (the tab key), it goes very quickly