10

I have several files as follow :

multiview_action.tgz.part-aa  
multiview_action.tgz.part-ab
...
...
multiview_action.tgz.part-ap  

I tried the following command :

tar -zxvf multiview_action.tgz*

I got the following error :

gzip: stdin: unexpected end of file
tar: Fin prématurée rencontrée dans l'archive.
tar: Error is not recoverable: exiting now
0

2 Answers 2

23

You should concatenate (cat) the split tar-gz files, decompress them (gunzip) and extract the tar archive (tar -x).

You can extract split .gz archives directly using the zcat command which concatenates and directly uncompresses the files. Then pipe the result to the tar extract command, creating no intermediate files:

zcat multiview_action.tgz.part-* | tar -x

Another option (with a different grouping of the 3 mentioned commands) is to use cat piped to tar with the z option:

cat multiview_action.tgz.part-* | tar -xz
7

Files are divided with split, to join the file you need to use cat before you can extract your .tgz file:

cat multiview_action.tgz.part-* > multiview_action.tgz

If you leave out -z from options tar will guess archive type by the file .ext:

tar -xf multiview_action.tgz
2
  • Creating a temporary file is not necessary and might be unfeasible if the archive is too big. See my answer for solutions without temporary files.
    – Melebius
    Jul 1, 2020 at 6:31
  • true if you don't intend to save the original archive.
    – user986805
    Jul 1, 2020 at 12:21

Not the answer you're looking for? Browse other questions tagged .