TAR and GZIP issues
Not sure if this is really in the right forum but here goes....
Looking for a way to extract individual compressed files from a compressed tarball WITHOUT tar -zxvf and then recompressing. Basically we need to be able to chunk out an individual compressed file while it still remains compressed.
For whatever reason, when we tar out the single, then recompress it's destroying the file integrity. The files are so large that we can't just decompress the whole then pick out pieces, so that's out.
We had looked at going in and extracting the bits and writing them elsewhere, but from what I understand about how tar and gzip work, we'd get garbage because the gzip algorithm is predicated on the overall file rather than the pieces when working with a tarball. To gunzip the individual pieces would rely upon the initial Huffman double encoded "rosetta stone" that was generated from the overall tarball structure, right? Without that "rosetta stone", we'd not be able to accurately decompressed the individual .gzs....and a reverse algorithm wouldn't work because the initial was encoded off of patterns that were present in the whole but may not be present in the individual.
I'm a bit of a n00b, so I just need to check and make sure I've absorbed this all correctly. But, in case I've processed it all incorrectly and if there is a way or a script that can accomplish this, please point me in the right direction. Thanks.
Originally Posted by athos
Note that if the file is within one or more directories it needs to be qualified with the path and it will be extracted in that path (relative to your current location.)
tar zxvf yourtarfilegoeshere file_1_witihin_tarfile .... file_N_within_tarfile
If you need to know the "filenames" in the tarball:
And yes the tar command does not need the "-" for the options and its addition is relativly new.
tar zt yourtarfilegoeshere