Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

linux command to combine two tar.gz files [closed]

Tags:

linux

I have a tar.gz file that is split into two files for example x.tar.gz.00 and x.tar.gz.01. How to combine these two tar files in linux?

I tried with this below command but no success.

zcat X.tar.gz.00 X.tar.gz.01 | gzip -c > X.tar.gz. 

It returned

gzip: X.tar.gz.00: unexpected end of file

Thanks.

like image 841
Megatron Avatar asked Feb 14 '23 01:02

Megatron


1 Answers

If you split the file after compressing it, as the error suggests, then just concatenate the files directly:

cat X.tar.gz.00 X.tar.gz.01 > X.tar.gz
like image 93
Barmar Avatar answered Feb 28 '23 10:02

Barmar