for a in `ls -1 *.tar.*`
do
tar -zxvf $a
done
http://castyour.net/untar-all-files-directory
Bash for loop examples
http://www.cyberciti.biz/faq/bash-for-loop/
Other arguments
http://www.thegeekstuff.com/2010/04/unix-tar-command-examples/
tar error - 'Child returned status 1'
http://www.linuxquestions.org/questions/linux-newbie-8/tar-error-'child-returned-status-1'-208083/
You used "tar -zxvf" for the second command. the 'z' option tells tar to use gzip to uncompress the file. Since you already uncompressed it in the first command, gzip doesn't know what to do with it, and it consequently croaks. Tar stops because gzip encountered a problem. So, with the file you have now, you would extract it with:
tar -xvf xxxxxx.x.x.tar
I would go back and re-gzip the tar file though (to save space):
gzip xxxxxx.x.x.tar
tar -zxvf xxxxxx.x.x.tar.gz
The first step uncompresses the tar ball.
In the second step, tar is expecting a compressed tar ball (.tar.gz).
You can either do:
Code:
tar -xvf fileName.tar
or
Code:
tar -xzvf fileName.tar.gz
I hope this helps
--Ian
No comments:
Post a Comment