I have 100 files:
gzip 100 files into one
.gz file, so that after I
gunzip it, I should have
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.Sign up to join this community
You'll want to use tar, like so:
tar -czvf file.tar.gz cvd*.txt
tar puts the files together, while gzip then performs the compression.
Quoth the gzip manpage:
If you wish to create a single archive file with multiple members so that members can later be extracted independently, use an archiver such as tar or zip. GNU tar supports the -z option to invoke gzip transparently. gzip is designed as a complement to tar, not as a replacement
You can do it using:
zip my_final_filename.zip my_first_file my_second_file ... my_last_file unzip my_final_filename.gz
tar cvzf my_final_filename.tar.gz my_first_file my_second_file ... my_last_file tar -czvf my_final_filename.tar.gz
gzip is not capable of doing that. In case of more information please look at comments.