How can I use Terminal to copy all files of a certain type from a failing hard drive?
I use rsync to do this sort of copy

for example 

rsync -aE source_dir/*.jpg target_dir


The option E copies the ACLs and a does the unix permissions and times ad recurses down the directoty tree

rsync can also be setup to copy to remote machines without mounting drives.

There are some GUI front ends for rsync e.g. aRsync.

Note Applke supplies an old version newr versions can be got from packae managers and see the current rsync man page Note the command line -aE seems to be -AX now.