Miscellaneous > Programming & Networking
Archive and Source
Master of Reality:
whats the difference between zip, gzip, and bzip(2)??
Kintaro:
gzip fast
bzip2 slow
gzip reasonable compression
bzip2 brilliant compression.
zip reasonable compression and speed.
voidmain:
quote:Originally posted by The Master of Reality / B0B:
whats the difference between zip, gzip, and bzip(2)??
--- End quote ---
Well, the difference between zip and gzip is "g". The difference between zip and bzip is "b". The difference between gzip and bzip is a little more complex. I'll have to think about that one for a while.
Actually gzip, bzip, and bzip2 are all designed to compress a single file or a stream. They each use different compression algorithms, some better for compression, some better for speed. These also are good for streaming compression. zip has a couple of different algorythms based on passed options, also can archive multiple files, can do encryption, etc. zip is not designed for compressing streams.
[ November 01, 2002: Message edited by: void main ]
pkd_lives:
Ahhh....Now it all makes a lot more sense - I like that streaming file idea, it somehow feels natural, like so much in UNIX.
Thanks all who have responded. That has added several pieces of useful information to my knowledge base. And Void..far from being too much the answers I received in this thread are EXACTLY what I wanted and needed to know. I can handle these files on a normal basis just by typing a command, but I have that engineers NEED to know what is happening...You know what I mean, and I'm sure you do?
So to get it straight, tar was a way of streaming data to a file, but now it's used primarily to preserve data formats, and permissions, file structures, and the essentials for dealing with the enclosed source code of the file, whilst the zips perform those nice tasks of compressing the data so that it is not huge files.
I guessed it was the equivalent of PK and Win zip, but it's the difference between guessing and learning that seperates the boys from the men.
voidmain:
quote:Originally posted by pkd:
So to get it straight, tar was a way of streaming data to a file, but now it's used primarily to preserve data formats, and permissions, file structures, and the essentials for dealing with the enclosed source code of the file, whilst the zips perform those nice tasks of compressing the data so that it is not huge files.
--- End quote ---
Well, it works just as well (or better) than zip for archiving source code but it certainly has not left as a tool used for archiving to tape. In fact I used tar to back my computer up to my Video camera just today. I use it to back up to DLT drives too. Source code is one thing that you want to be able to "archive" and distribute. "cpio" is another utility used for backups and creating archives but less commonly used.
And a simple example of compressing a stream would be:
# tar -cvf - somedir | gzip | dd of=/dev/tape obs=512
Of course with GNU tar you can just do:
# tar --block-size 1 -cvzf /dev/tape somedir
to do the same thing. You can't do that with zip/pkzip/winzip.
[ November 01, 2002: Message edited by: void main ]
Navigation
[0] Message Index
[*] Previous page
Go to full version