Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Is it possible to use GZip to create a .zip file? I've been Googling and can't find anything that leads me to believe this is possible

share|improve this question
1  
and not use zip? –  quanta Sep 27 '11 at 13:04

3 Answers 3

up vote 7 down vote accepted

You probably want to use zip and not gzip. This should do it:

zip -r newzip.zip /path/to/zip/stuff
share|improve this answer

This is not possible. gzip and (pk)zip use different compression formats, and more significantly, zip also packages multiple files, directories, together in one archive.

share|improve this answer
2  
They (currently) use the same compression format (deflate), they just package things differently. –  Ignacio Vazquez-Abrams Sep 27 '11 at 16:41

The original zip format is the same as:

 tar -cZf package.zip files....

(note the capital Z uses the compress lib - using the small 'z' would give a gzipped archive which pk/winzip can't understand).

i.e. no, you can't use gzip to create a pkzip file - but I'd be surprised to find a Unix machine which had gzip but not compress.

share|improve this answer
    
No it isn't. Zip files are more than just a tarball passed through compress. –  Ignacio Vazquez-Abrams Sep 27 '11 at 16:42
    
Similar to != same as. Tar stores unis permissions and such that zip does not. Zip also compresses only 32kb at a time so that you can extract a single file without having to decompress everything that came before it; tar compresses the whole thing at once ( giving better compression ). Most importantly, they are different file formats that are not recognized by the other tool. –  psusi Sep 27 '11 at 17:55

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.