1.10.39 6.39. Gzip-1.3.5

优质
小牛编辑
113浏览
2023-12-01

gzip 包含用 Lempel-Ziv 编码(LZ77)来压缩和解压文件的程序。

预计编译时间: 少于 0.1 SBU所需磁盘空间: 2.2 MB

6.39.1. 安装 Gzip

Gzip 有两个安全漏洞,下面的补丁可以修正它:

patch -Np1 -i ../gzip-1.3.5-security_fixes-1.patch

为编译 Gzip 做准备:

./configure --prefix=/usr

gzexe 脚本里包含对 gzip 程序的硬路径引用。由于我们后面要改变 gzip 程序的位置,就需要用下面的命令改变脚本中的硬路径:

sed -i '[email protected]"BINDIR"@/[email protected]' gzexe.in

编译软件包:

make

这个软件包没有附带测试程序。

安装软件包:

make install

gzip 程序移动到 /bin 目录并创建一些常用的符号连接:

mv -v /usr/bin/gzip /bin
rm -v /usr/bin/{gunzip,zcat}
ln -sv gzip /bin/gunzip
ln -sv gzip /bin/zcat
ln -sv gzip /bin/compress
ln -sv gunzip /bin/uncompress

6.39.2. Gzip 的内容

安装的程序: compress(→gzip), gunzip(→gzip), gzexe, gzip, uncompress(→gunzip), zcat(→gzip), zcmp, zdiff, zegrep, zfgrep, zforce, zgrep, zless, zmore, znew

简要描述

compress压缩和解压缩文件
gunzip解压由 gzip 压缩过的文件
gzexe将文件压缩成可以自解压的可执行文件
gzip通过 Lempel-Ziv 编码(LZ77)压缩指定的文件
uncompress解压由 gzip 压缩过的文件
zcat将解压缩的数据写到标准输出上
zcmp在压缩文件上调用 cmp 命令
zdiff在压缩文件上调用 diff 命令
zegrep在压缩文件上调用 egrep 命令
zfgrep在压缩文件上调用 fgrep 命令
zforce强制性地为每一个 gzip 文件加上 .gz 扩展名,这样gzip 就不会对它们再次进行压缩。这个程序可能在一个文件经过传输后名字被截短的情况下能够派上用场。
zgrep在压缩文件上调用 grep 命令
zless在压缩文件上调用 less 命令
zmore在压缩文件上调用 more 命令
znew.Z格式的文件(使用 compress 压缩)转压缩成.gz格式(使用 gzip 压缩)