This should work:
Code:
for foo in *.tar.gz; do tar xvzf $foo; done
Reason why you cant use a wild card is because all the filenames that match the wildcard will be passed to tar as the argument.
So tar xvzf *.tar.gz is equivalent to
Code:
tar xvzf 1.tar.gz 2.tar.gz 3.tar.gz so-on.tar.gz
Which it'll complain because the arguments after 1.tar.gz is suppose to be individual files you want to extract.
What you want to achieve is
Code:
tar xvzf 1.tar.gz
tar xvzf 2.tar.gz
tar xvzf and-so-on.tar.gz