zlib是库
gzip是程序,生成gzip时使用了zlib
Since the late 1990s, bzip2, a file compression utility based on a block-sorting algorithm, has gained some popularity as a gzip replacement. It produces considerably smaller files (especially for source code and other structured text), but at the cost of memory and processing time (up to a factor of 4). bzip2-compressed archive files are conventionally named .tar.bz2, .tbz2 or .tbz.
Although its file format also allows for multiple such streams to be concatenated (zipped files are simply decompressed concatenated as if they were originally one file), gzip is normally used to compress just single files.[4] Compressed archives are typically created by assembling collections of files into a single tar archive, and then compressing that archive with gzip. The final.tar.gz or .tgz file is usually called a "tarball".[5]
Gzip is not to be confused with the ZIP archive format, which also uses DEFLATE. The ZIP format can hold collections of files without an external archiver, but is less compact than compressed tarballs holding the same data, because it compresses files individually and cannot take advantage of redundancy between files (solid compression).
zip
Zip is a file format used for data compression and archiving. A zip file contains one or more files that have been compressed, to reduce file size, or stored as is. The zip file format permits a number of compression algorithms. The format was originally created in 1989 by Phil Katz, and was first implemented in PKWARE's PKZIP utility,[2] as a replacement for the previous ARC compression format by Thom Henderson. The zip format is now supported by many software utilities other than PKZIP. Microsoft has included built-in zip support (under the name "compressed folders") in versions of Microsoft Windows since 1998. Apple has included built-in zip support in Mac OS X 10.3 (via BOMArchiveHelper, now Archive Utility) and later, along with other compression formats.
Zip files generally use the file extensions ".zip" or ".ZIP" and the MIME media type application/zip
.[1] Zip is used as a base file format by many programs, usually under a different name. Zip files are often represented by a document or other object prominently featuring a zipper.