If and only if the filenames for each of the nested tar do not collide, you can do the following.
for i in `seq 1 4`; do name=$(ls *.tar.gz); tar xvfz $name; rm $name; done;
If they are all the same, like foo.tar.gz
inside foo.tar.gz
inside foo.tar.gz
, you can simply delete the rm $name
from the above.
If there are only some collisions you will have to play more clever tricks, such as moving intermediate files into another directory.
Update: If you just want to move the final tar to a new directory, just do use mv
after the loop above.
mv *.tar.gz OtherDirectoryName