I'm trying to combine multiple (29) compressed files (.gz), one after the other, into one file.
The compressed files are around 500MB and in their uncompressed format ~30GB. All the files start with a header that I don't want in the final file.
I have tried to do it using zcat
and gzip
, but it takes a lot of time (more than 3hours):
zcat file*.gz | tail -n +2 | gzip -c >> all_files.txt.gz
I have also tried it with pigz
:
unpigz -c file*.gz | tail -n +2 | pigz -c >> all_files_pigz.txt.gz
In this case, I'm working in a cluster where they don't have this command and I can't install anything.
The last thing I have tried is to merge all with cat
:
cat file*.gz > all_files_cat.txt.gz
It doesn't take a lot of time, but when I'm going to read it, at some pint appears the following message:
gzip: unexpected end of file
How could I deal with this?