1819941 Members
3404 Online
109607 Solutions
New Discussion юеВ

zip vs gzip

 
SOLVED
Go to solution
Chern Jian Leaw
Regular Advisor

zip vs gzip

HI,

I tried doing a zip on a .tar file:
#zip -v file.tar
zip warning: missing end signature--probably not a zip file(did you remember to use binary mode when you transferred it?)

#zip -F file.tar
zip warning: file.tar would be truncated.
Retry with option -qF to truncate, -FF to attempt full recovery.

zip error: Zip file structure invalid(file.tar)

Could someone show me how I could apply zip on a .tar file?

I'm able to do a gzip on a .tar file, but I'm having troubles with zip.

What are the differences between gzip and zip?
Can zip handle .tar files? What are the limitations of zip and gzip?

Could someone kindly help me out.
Thanks

9 REPLIES 9
Jean-Louis Phelix
Honored Contributor

Re: zip vs gzip

hi,

What is zip on hp-ux ? I only know gzip. The message you give seems to be an uncompression message rather than a compression message. Where did you find it ?

Regards
It works for me (┬й Bill McNAMARA ...)
Stefan Farrelly
Honored Contributor

Re: zip vs gzip


Try;
cat file.tar | zip > file.zip

zip isnt commonly used. HP's uses compress, the newew gzip (better compression) and the even newer bzip2 (even better compression). gzip is a bit more robust - you can gzip anything (gzip file, or cat file | gzip > newfile, or gunzip file) but zip is really for windows/PC's. Winzip on windows/PC's understands tar files or gzip files perfectly so there is really no need to use zip. We dont.
Im from Palmerston North, New Zealand, but somehow ended up in London...
Chern Jian Leaw
Regular Advisor

Re: zip vs gzip

Jean-Louise,

I'm executing zip on a HPUX 10.20, which I placed it on /usr/local/bin/. The zip version which I'm running is zip 2.1

Any ideas?

Thanks
T G Manikandan
Honored Contributor

Re: zip vs gzip

#tar cf - . | zip test -


This should create a zip file called test

ALso you can try doing a

#zip test1 file.tar


This should create a test1.zip


Revert
Bill McNAMARA_1
Honored Contributor

Re: zip vs gzip

you probably got zip from http://hpux.cs.utah.edu/ as it is not standard unix.
I recommend gzip as winders will be able to decompress it. You can also get better compression with
gzip -9 file

Later,
Bill
It works for me (tm)
H.Merijn Brand (procura
Honored Contributor

Re: zip vs gzip

Forget both zip and gzip. Use bzip2. For 10.20 binaries are available on https://www.beepz.com/personal/merijn

For tar archives with source files, bzip2 compresses 30% better than gzip -9

Original URL's:

bzip2: http://sources.redhat.com/bzip2/
gzip: ftp://download.xs4all.nl/pub/mirror/gnu/gzip/
zip: http://www.info-zip.org/pub/infozip/
unzip: http://www.info-zip.org/pub/infozip/
zlib: http://www.gzip.org/zlib/

.tar.gz .tar.bz2 .tar.Z .zip .tgz .tbz are all recognized by powerarchiver on the PC (http://www.powerarchiver.com)
Enjoy, Have FUN! H.Merijn
Chern Jian Leaw
Regular Advisor

Re: zip vs gzip

Is there a performance issue when using gzip over zip for compressing large files?
Chern Jian Leaw
Regular Advisor

Re: zip vs gzip

Procura,
Thanks for those useful links. But if I'm not mistaken, zlib uses the gzip compression algorithm, hence, does zlib has better compression rate compared to gzip for large filesystems i.e > 2GB?

thanks
H.Merijn Brand (procura
Honored Contributor
Solution

Re: zip vs gzip

Thanks for those useful links. But if I'm not mistaken, zlib uses the gzip compression algorithm, hence, does zlib has better compression rate compared to gzip for large filesystems i.e > 2GB?

The other way round. gzip uses zlib :)
zlib has been updated not so long ago because of some security issues

bzip has a much better compression algorithm, in any case for non-binary files

AFAIK zip/unzip is not actively maintained, and will thus not have the highest compression rate

I'm open for corrections regarding this info :)






[points]
Enjoy, Have FUN! H.Merijn