2

Trying to create a .gz archive - my_gz.gz - and add multiple files to it:

  $ gzip my_gz.gz file1.txt file12.txt

  gzip: can't stat: my_gz.gz: No such file or directory
1

1 Answer 1

5

You cannot add multiple files using gzip because it is only a compression program, not an archiver. To compress multiple files, you would want to use tar with gzip:

tar czf archive.tar.gz file1.txt file2.txt

The z tells the archiver to automatically use gzip for compression. You could also tell it to use different compression algorithm. See the tar(1) manual page for more information on this.

0

You must log in to answer this question.

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