.gz
Archive
gzip(GNU Zip 压缩)
GZ 是 gzip 压缩文件的扩展名,gzip 是 Unix 和 Linux 系统上的标准压缩工具。Gzip 使用 DEFLATE 算法压缩单个文件 — 要压缩多个文件,通常与 TAR 配对创建 .tar.gz(tgz)归档。
MIME 类型
application/gzip
类型
二进制
压缩
无损
优点
- + Universal support on Unix/Linux and in HTTP content encoding
- + Fast decompression speed
- + Simple single-file compression with integrity checking
缺点
- − Compresses only one file — needs TAR for directories
- − Lower compression ratio than bzip2, xz, or Zstandard
- − No encryption support built into the format
何时使用 .GZ
在压缩单个文件、Web 服务器内容编码以及与 TAR 配对创建多文件归档时使用 gzip。
技术细节
Gzip 使用 DEFLATE 压缩(LZ77 + 霍夫曼编码),带有包含魔数、时间戳和操作系统标识的 10 字节头部。CRC-32 校验和与原始文件大小作为尾部附加。
历史
Jean-loup Gailly 和 Mark Adler 于 1992 年创建了 gzip,作为受 LZW 专利困扰的 Unix compress 实用程序的免费替代品。Gzip 成为 HTTP 内容编码和 Linux 软件包的默认压缩工具。