tar command will only do one file at a time
I'm trying to untar and ungzip three tar.gz . First I tried the command: tar -fixz *.tar.gz, but I found I needed to rearrange the letters. I ended up with tar -xzf ./*tar.gz . It says the files I want to open are "not found in archive." What does that mean?
(BTW, the tar command works when I try to do just one file.) |
When I use tar, I never use the dash (it's not necessary) and I always use the 'v' option (verbose) mode. So try something like this:
tar xvzf *.tar.gz If that doesn't work, try doing it specifically for each file. I'd bet one (or more) of them is bad. Then if you're really nosy, you can whip out gzip to test the integrity of the gz file(s) that fail, and maybe even use tar to check the tar archive as well. |
i have run into something like this.
i had to gunzip the files first then untar them. don't know how to get past the multi file prob but maybe if you try this (after gunzip) tar -xvf filename.tar filename.tar now i don't know if this will work or not i have never tried it. |
Try the following:
tar -cvf - files | (cd target directory ; tar xpf -) This will copy the file to a the new directory in an uncompressed state. Good luck, Freestone |
If you type tar --help, at the begining you will see the following:
Quote:
Try the following: "echo tar -xzf ./*tar.gz" You will get something like: tar -xzf ./tarfile1.tar.gz ./tarfile2.tar.gz ./tarfile3.tar.gz This means you are telling tar to extract the files ./tarfile2.tar.gz ./tarfile3.tar.gz from the file ./tarfile1.tar.gz. This is why it says .the files are "not found in archive." If you want to do all the tarfiles at once, try the following: "for file in *.gz; do tar -xzf $file; done" Of course, you may want to try the following first: so you can see what would happen "for file in *.gz; do echo tar -xzf $file; done" |
All times are GMT -5. The time now is 02:16 AM. |