There are more command line to rename files. If you have not got rename command line, you could use follow tips:

ls -d *.foo | sed -e 's/.*/mv & &/' -e 's/foo$/bar/' | sh

Reference: faqs.org