Although mogrify
seems to do the job, I would like to show you how this can be done with multiple commands with convert
from ImageMagick.
I think multiple commands are better, because the number of file types is supposedly quite small and you can better adjust it to your needs:
This command:
for file in *.xbm; do convert $file "`basename $file .xbm`.png"; done
will convert all .xbm
files to .png
while not touching the xbm files.
Then you can move all "converted" files:
mkdir converted
for file in *.xbm; do mv $file converted/; done