man gzip
GZIP(1) GZIP(1)
NAME/名称
gzip, gunzip, zcat - compress or expand files/压缩或展开文件
gzip, gunzip, zcat - compress or expand files/压缩或展开文件
SYNOPSIS/简介
gzip [ -acdfhlLnNrtvV19 ] [-S suffix] [ name ... ]/后缀
gunzip [ -acfhlLnNrtvV ] [-S suffix] [ name ... ]
zcat [ -fhLV ] [ name ... ]
gzip [ -acdfhlLnNrtvV19 ] [-S suffix] [ name ... ]/后缀
gunzip [ -acfhlLnNrtvV ] [-S suffix] [ name ... ]
zcat [ -fhLV ] [ name ... ]
DESCRIPTION/描述
Gzip reduces the size of the named files using Lempel-Ziv coding (LZ77). Whenever possible, each file is replaced by one with the extension .gz, while keeping the
same ownership modes, access and modification times. (The default extension is -gz for VMS, z for MSDOS, OS/2 FAT, Windows NT FAT and Atari.) If no files are
specified, or if a file name is "-", the standard input is compressed to the standard output. Gzip will only attempt to compress regular files. In particular, it
will ignore symbolic links.
gzip使用lempel-ziv编码(lz77)减小命名文件的大小。只要可能,每个文件都被扩展名为.gz的文件替换,同时保持相同的所有权模式、访问和修改时间。
(vms的默认扩展名是-gz,msdos的默认扩展名是z,os/2 fat,windows nt fat和atari。)如果没有指定文件,或者文件名是“-”,则标准输入被压缩为标准输出。
gzip将只尝试压缩常规文件。特别是,它将忽略符号链接。
If the compressed file name is too long for its file system, gzip truncates it. Gzip attempts to truncate only the parts of the file name longer than 3 charac-
ters. (A part is delimited by dots.) If the name consists of small parts only, the longest parts are truncated. For example, if file names are limited to 14 char-
acters, gzip.msdos.exe is compressed to gzi.msd.exe.gz. Names are not truncated on systems which do not have a limit on file name length.
如果压缩文件名对其文件系统太长,gzip将截断它。gzip只尝试截断文件名中超过3个字符的部分。(一部分用点分隔)如果名称仅由小部分组成,则最长的部分将被截断。
例如,如果文件名限制为14个字符,则gzip.msdos.exe被压缩为gzi.msd.exe.gz。对于文件名长度没有限制的系统,名称不会被截断。
Gzip reduces the size of the named files using Lempel-Ziv coding (LZ77). Whenever possible, each file is replaced by one with the extension .gz, while keeping the
same ownership modes, access and modification times. (The default extension is -gz for VMS, z for MSDOS, OS/2 FAT, Windows NT FAT and Atari.) If no files are
specified, or if a file name is "-", the standard input is compressed to the standard output. Gzip will only attempt to compress regular files. In particular, it
will ignore symbolic links.
gzip使用lempel-ziv编码(lz77)减小命名文件的大小。只要可能,每个文件都被扩展名为.gz的文件替换,同时保持相同的所有权模式、访问和修改时间。
(vms的默认扩展名是-gz,msdos的默认扩展名是z,os/2 fat,windows nt fat和atari。)如果没有指定文件,或者文件名是“-”,则标准输入被压缩为标准输出。
gzip将只尝试压缩常规文件。特别是,它将忽略符号链接。
If the compressed file name is too long for its file system, gzip truncates it. Gzip attempts to truncate only the parts of the file name longer than 3 charac-
ters. (A part is delimited by dots.) If the name consists of small parts only, the longest parts are truncated. For example, if file names are limited to 14 char-
acters, gzip.msdos.exe is compressed to gzi.msd.exe.gz. Names are not truncated on systems which do not have a limit on file name length.
如果压缩文件名对其文件系统太长,gzip将截断它。gzip只尝试截断文件名中超过3个字符的部分。(一部分用点分隔)如果名称仅由小部分组成,则最长的部分将被截断。
例如,如果文件名限制为14个字符,则gzip.msdos.exe被压缩为gzi.msd.exe.gz。对于文件名长度没有限制的系统,名称不会被截断。
By default, gzip keeps the original file name and timestamp in the compressed file. These are used when decompressing the file with the -N option. This is useful
when the compressed file name was truncated or when the time stamp was not preserved after a file transfer.
默认情况下,gzip在压缩文件中保留原始文件名和时间戳。在用-n选项解压缩文件时使用这些选项。当压缩文件名被截断或文件传输后时间戳未被保留时,此选项非常有用。
when the compressed file name was truncated or when the time stamp was not preserved after a file transfer.
默认情况下,gzip在压缩文件中保留原始文件名和时间戳。在用-n选项解压缩文件时使用这些选项。当压缩文件名被截断或文件传输后时间戳未被保留时,此选项非常有用。
Compressed files can be restored to their original form using gzip -d or gunzip or zcat. If the original name saved in the compressed file is not suitable for its
file system, a new name is constructed from the original one to make it legal.
压缩文件可以使用gzip-d、gunzip或zcat还原为原始格式。如果压缩文件中保存的原始名称不适合其文件系统,则从原始名称构建新名称以使其合法。
file system, a new name is constructed from the original one to make it legal.
压缩文件可以使用gzip-d、gunzip或zcat还原为原始格式。如果压缩文件中保存的原始名称不适合其文件系统,则从原始名称构建新名称以使其合法。
gunzip takes a list of files on its command line and replaces each file whose name ends with .gz, -gz, .z, -z, _z or .Z and which begins with the correct magic
number with an uncompressed file without the original extension. gunzip also recognizes the special extensions .tgz and .taz as shorthands for .tar.gz and .tar.Z
respectively. When compressing, gzip uses the .tgz extension if necessary instead of truncating a file with a .tar extension.
gunzip在其命令行上获取文件列表,并将名称以.gz、-gz、.z、-z、-z或.z结尾的每个文件替换为以正确的幻数开头的未压缩文件,但没有原始扩展名。
gunzip还将特殊扩展名.tgz和.taz分别识别为.tar.gz和.tar.z的缩写。压缩时,gzip在必要时使用.tgz扩展名,而不是截断扩展名为.tar的文件。
number with an uncompressed file without the original extension. gunzip also recognizes the special extensions .tgz and .taz as shorthands for .tar.gz and .tar.Z
respectively. When compressing, gzip uses the .tgz extension if necessary instead of truncating a file with a .tar extension.
gunzip在其命令行上获取文件列表,并将名称以.gz、-gz、.z、-z、-z或.z结尾的每个文件替换为以正确的幻数开头的未压缩文件,但没有原始扩展名。
gunzip还将特殊扩展名.tgz和.taz分别识别为.tar.gz和.tar.z的缩写。压缩时,gzip在必要时使用.tgz扩展名,而不是截断扩展名为.tar的文件。
gunzip can currently decompress files created by gzip, zip, compress, compress -H or pack. The detection of the input format is automatic. When using the first
two formats, gunzip checks a 32 bit CRC. For pack, gunzip checks the uncompressed length. The standard compress format was not designed to allow consistency
checks. However gunzip is sometimes able to detect a bad .Z file. If you get an error when uncompressing a .Z file, do not assume that the .Z file is correct sim-
ply because the standard uncompress does not complain. This generally means that the standard uncompress does not check its input, and happily generates garbage
output. The SCO compress -H format (lzh compression method) does not include a CRC but also allows some consistency checks.
gunzip目前可以解压缩gzip、zip、compress、compress-h或pack创建的文件。输入格式的检测是自动的。当使用前两种格式时,gunzip检查32位CRC。
对于pack,gunzip检查未压缩的长度。标准压缩格式不允许一致性检查。然而,gunzip有时可以检测到一个坏的.z文件。
如果在解压缩.z文件时出现错误,不要仅仅因为标准解压缩没有抱怨就假定.z文件是正确的。这通常意味着标准的uncompress不检查它的输入,而是愉快地生成垃圾输出。
sco compress-h格式(lzh compression method)不包括CRC,但也允许一些一致性检查。
two formats, gunzip checks a 32 bit CRC. For pack, gunzip checks the uncompressed length. The standard compress format was not designed to allow consistency
checks. However gunzip is sometimes able to detect a bad .Z file. If you get an error when uncompressing a .Z file, do not assume that the .Z file is correct sim-
ply because the standard uncompress does not complain. This generally means that the standard uncompress does not check its input, and happily generates garbage
output. The SCO compress -H format (lzh compression method) does not include a CRC but also allows some consistency checks.
gunzip目前可以解压缩gzip、zip、compress、compress-h或pack创建的文件。输入格式的检测是自动的。当使用前两种格式时,gunzip检查32位CRC。
对于pack,gunzip检查未压缩的长度。标准压缩格式不允许一致性检查。然而,gunzip有时可以检测到一个坏的.z文件。
如果在解压缩.z文件时出现错误,不要仅仅因为标准解压缩没有抱怨就假定.z文件是正确的。这通常意味着标准的uncompress不检查它的输入,而是愉快地生成垃圾输出。
sco compress-h格式(lzh compression method)不包括CRC,但也允许一些一致性检查。
Files created by zip can be uncompressed by gzip only if they have a single member compressed with the ?.eflation?.method. This feature is only intended to help
conversion of tar.zip files to the tar.gz format. To extract a zip file with a single member, use a command like gunzip <foo.zip or gunzip -S .zip foo.zip. To
extract zip files with several members, use unzip instead of gunzip.
由zip创建的文件只有在有一个用?压缩的单个成员时,才可以由gzip解压缩。煽动?方法。此功能仅用于帮助将tar.zip文件转换为tar.gz格式。要提取具有单个成员的zip文件,
请使用gunzip<foo.zip或gunzip-s.zip foo.zip等命令。要提取包含多个成员的zip文件,请使用unzip而不是gunzip。
conversion of tar.zip files to the tar.gz format. To extract a zip file with a single member, use a command like gunzip <foo.zip or gunzip -S .zip foo.zip. To
extract zip files with several members, use unzip instead of gunzip.
由zip创建的文件只有在有一个用?压缩的单个成员时,才可以由gzip解压缩。煽动?方法。此功能仅用于帮助将tar.zip文件转换为tar.gz格式。要提取具有单个成员的zip文件,
请使用gunzip<foo.zip或gunzip-s.zip foo.zip等命令。要提取包含多个成员的zip文件,请使用unzip而不是gunzip。
zcat is identical to gunzip -c. (On some systems, zcat may be installed as gzcat to preserve the original link to compress.) zcat uncompresses either a list of
files on the command line or its standard input and writes the uncompressed data on standard output. zcat will uncompress files that have the correct magic number
whether they have a .gz suffix or not.
zcat与gunzip-c相同。(在某些系统中,zcat可以安装为gzcat以保留要压缩的原始链接。)zcat解压缩命令行或其标准输入上的文件列表,并将未压缩的数据写入标准输出。
zcat将解压具有正确幻数的文件,无论其后缀是否为.gz。
files on the command line or its standard input and writes the uncompressed data on standard output. zcat will uncompress files that have the correct magic number
whether they have a .gz suffix or not.
zcat与gunzip-c相同。(在某些系统中,zcat可以安装为gzcat以保留要压缩的原始链接。)zcat解压缩命令行或其标准输入上的文件列表,并将未压缩的数据写入标准输出。
zcat将解压具有正确幻数的文件,无论其后缀是否为.gz。
Gzip uses the Lempel-Ziv algorithm used in zip and PKZIP. The amount of compression obtained depends on the size of the input and the distribution of common sub-
strings. Typically, text such as source code or English is reduced by 60-70%. Compression is generally much better than that achieved by LZW (as used in com-
press), Huffman coding (as used in pack), or adaptive Huffman coding (compact).
gzip使用zip和pkzip中使用的lempel-ziv算法。获得的压缩量取决于输入的大小和公共子串的分布。通常,源代码或英语等文本会减少60-70%。
压缩通常比LZW(在压缩中使用)、哈夫曼编码(在压缩包中使用)或自适应哈夫曼编码(压缩)所实现的压缩要好得多。
strings. Typically, text such as source code or English is reduced by 60-70%. Compression is generally much better than that achieved by LZW (as used in com-
press), Huffman coding (as used in pack), or adaptive Huffman coding (compact).
gzip使用zip和pkzip中使用的lempel-ziv算法。获得的压缩量取决于输入的大小和公共子串的分布。通常,源代码或英语等文本会减少60-70%。
压缩通常比LZW(在压缩中使用)、哈夫曼编码(在压缩包中使用)或自适应哈夫曼编码(压缩)所实现的压缩要好得多。
Compression is always performed, even if the compressed file is slightly larger than the original. The worst case expansion is a few bytes for the gzip file
header, plus 5 bytes every 32K block, or an expansion ratio of 0.015% for large files. Note that the actual number of used disk blocks almost never increases.
gzip preserves the mode, ownership and timestamps of files when compressing or decompressing.
即使压缩文件比原始文件稍大,也始终执行压缩。最坏情况下,gzip文件头的扩展为几个字节,每32K块加5个字节,或者大文件的扩展率为0.015%。
请注意,实际使用的磁盘块数几乎从不增加。gzip在压缩或解压缩时保留文件的模式、所有权和时间戳。
header, plus 5 bytes every 32K block, or an expansion ratio of 0.015% for large files. Note that the actual number of used disk blocks almost never increases.
gzip preserves the mode, ownership and timestamps of files when compressing or decompressing.
即使压缩文件比原始文件稍大,也始终执行压缩。最坏情况下,gzip文件头的扩展为几个字节,每32K块加5个字节,或者大文件的扩展率为0.015%。
请注意,实际使用的磁盘块数几乎从不增加。gzip在压缩或解压缩时保留文件的模式、所有权和时间戳。
The gzip file format is specified in P. Deutsch, GZIP file format specification version 4.3, <ftp://ftp.isi.edu/in-notes/rfc1952.txt>, Internet RFC 1952 (May
1996). The zip deflation format is specified in P. Deutsch, DEFLATE Compressed Data Format Specification version 1.3, <ftp://ftp.isi.edu/in-notes/rfc1951.txt>,
Internet RFC 1951 (May 1996).
gzip文件格式在p.deutsch,gzip文件格式规范版本4.3中指定,<ftp://ftp.isi.edu/in notes/rfc1952.txt>,internet rfc 1952(1996年5月)。
压缩压缩格式在p.deutsch,deflate compressed data format specification version 1.3中指定,<ftp://ftp.isi.edu/in notes/rfc1951.txt>,internet rfc 1951(1996年5月)。
1996). The zip deflation format is specified in P. Deutsch, DEFLATE Compressed Data Format Specification version 1.3, <ftp://ftp.isi.edu/in-notes/rfc1951.txt>,
Internet RFC 1951 (May 1996).
gzip文件格式在p.deutsch,gzip文件格式规范版本4.3中指定,<ftp://ftp.isi.edu/in notes/rfc1952.txt>,internet rfc 1952(1996年5月)。
压缩压缩格式在p.deutsch,deflate compressed data format specification version 1.3中指定,<ftp://ftp.isi.edu/in notes/rfc1951.txt>,internet rfc 1951(1996年5月)。
OPTIONS/选项
-a --ascii
Ascii text mode: convert end-of-lines using local conventions. This option is supported only on some non-Unix systems. For MSDOS, CR LF is converted to LF
when compressing, and LF is converted to CR LF when decompressing.
ASCII文本模式:使用本地约定转换行尾。此选项仅在某些非UNIX系统上受支持。对于MSDOS,压缩时CR LF转换为LF,解压缩时LF转换为CR LF。
-c --stdout --to-stdout
Write output on standard output; keep original files unchanged. If there are several input files, the output consists of a sequence of independently com-
pressed members. To obtain better compression, concatenate all input files before compressing them.
在标准输出上写入输出;保持原始文件不变。如果有多个输入文件,则输出由一系列独立压缩的成员组成。为了获得更好的压缩,在压缩所有输入文件之前将它们连接起来。
-a --ascii
Ascii text mode: convert end-of-lines using local conventions. This option is supported only on some non-Unix systems. For MSDOS, CR LF is converted to LF
when compressing, and LF is converted to CR LF when decompressing.
ASCII文本模式:使用本地约定转换行尾。此选项仅在某些非UNIX系统上受支持。对于MSDOS,压缩时CR LF转换为LF,解压缩时LF转换为CR LF。
-c --stdout --to-stdout
Write output on standard output; keep original files unchanged. If there are several input files, the output consists of a sequence of independently com-
pressed members. To obtain better compression, concatenate all input files before compressing them.
在标准输出上写入输出;保持原始文件不变。如果有多个输入文件,则输出由一系列独立压缩的成员组成。为了获得更好的压缩,在压缩所有输入文件之前将它们连接起来。
-d --decompress --uncompress
Decompress./解压文件
Decompress./解压文件
-f --force
Force compression or decompression even if the file has multiple links or the corresponding file already exists, or if the compressed data is read from or
written to a terminal. If the input data is not in a format recognized by gzip, and if the option --stdout is also given, copy the input data without change
to the standard ouput: let zcat behave as cat. If -f is not given, and when not running in the background, gzip prompts to verify whether an existing file
should be overwritten.
即使文件有多个链接或相关文件的存在,或者压缩数据是从或从写到一个终端。如果输入数据不是GZIP识别的格式,如果选项--STDOUT也被给出,则无需修改复制输入数据。
标准输出:让ZCAT作为CAT。If-F is not given,and when not running in the background,GZIP prompts to verify where an existing file
应该写得太多了。
Force compression or decompression even if the file has multiple links or the corresponding file already exists, or if the compressed data is read from or
written to a terminal. If the input data is not in a format recognized by gzip, and if the option --stdout is also given, copy the input data without change
to the standard ouput: let zcat behave as cat. If -f is not given, and when not running in the background, gzip prompts to verify whether an existing file
should be overwritten.
即使文件有多个链接或相关文件的存在,或者压缩数据是从或从写到一个终端。如果输入数据不是GZIP识别的格式,如果选项--STDOUT也被给出,则无需修改复制输入数据。
标准输出:让ZCAT作为CAT。If-F is not given,and when not running in the background,GZIP prompts to verify where an existing file
应该写得太多了。
-h --help
Display a help screen and quit./显示帮助屏幕并退出。
Display a help screen and quit./显示帮助屏幕并退出。
-l --list
For each compressed file, list the following fields:/对于每个压缩文件,列出以下字段:
For each compressed file, list the following fields:/对于每个压缩文件,列出以下字段:
compressed size: size of the compressed file
uncompressed size: size of the uncompressed file
ratio: compression ratio (0.0% if unknown)
uncompressed_name: name of the uncompressed file
压缩大小:压缩文件的大小
未压缩大小:未压缩文件的大小
比率:压缩比率(如果未知,则为0.0%)
未压缩的名称:未压缩文件的名称
uncompressed size: size of the uncompressed file
ratio: compression ratio (0.0% if unknown)
uncompressed_name: name of the uncompressed file
压缩大小:压缩文件的大小
未压缩大小:未压缩文件的大小
比率:压缩比率(如果未知,则为0.0%)
未压缩的名称:未压缩文件的名称
The uncompressed size is given as -1 for files not in gzip format, such as compressed .Z files. To get the uncompressed size for such a file, you can use:
zcat file.Z | wc -c
对于不是gzip格式的文件(如compressed.z文件),未压缩的大小被指定为-1。要获取此类文件的未压缩大小,可以使用:
zcat file.z_wc-c
对于不是gzip格式的文件(如compressed.z文件),未压缩的大小被指定为-1。要获取此类文件的未压缩大小,可以使用:
zcat file.z_wc-c
In combination with the --verbose option, the following fields are also displayed:/结合--verbose选项,还将显示以下字段:
method: compression method
crc: the 32-bit CRC of the uncompressed data
date & time: time stamp for the uncompressed file
方法:压缩法
CRC:未压缩数据的32位CRC
日期和时间:未压缩文件的时间戳
crc: the 32-bit CRC of the uncompressed data
date & time: time stamp for the uncompressed file
方法:压缩法
CRC:未压缩数据的32位CRC
日期和时间:未压缩文件的时间戳
The compression methods currently supported are deflate, compress, lzh (SCO compress -H) and pack. The crc is given as ffffffff for a file not in gzip for-
mat.
目前支持的压缩方法有deflate、compress、lzh(sco compress-h)和pack。对于不是gzip格式的文件,crc被指定为ffffffff。
mat.
目前支持的压缩方法有deflate、compress、lzh(sco compress-h)和pack。对于不是gzip格式的文件,crc被指定为ffffffff。
With --name, the uncompressed name, date and time are those stored within the compress file if present.
使用--name时,未压缩的名称、日期和时间是存储在压缩文件中的名称(如果存在)。
使用--name时,未压缩的名称、日期和时间是存储在压缩文件中的名称(如果存在)。
With --verbose, the size totals and compression ratio for all files is also displayed, unless some sizes are unknown. With --quiet, the title and totals
lines are not displayed.
使用--verbose,还会显示所有文件的大小总计和压缩比,除非某些大小未知。带——安静,标题和总数不显示行
lines are not displayed.
使用--verbose,还会显示所有文件的大小总计和压缩比,除非某些大小未知。带——安静,标题和总数不显示行
-L --license
Display the gzip license and quit./显示GZIP许可证并退出。
Display the gzip license and quit./显示GZIP许可证并退出。
-n --no-name
When compressing, do not save the original file name and time stamp by default. (The original name is always saved if the name had to be truncated.) When
decompressing, do not restore the original file name if present (remove only the gzip suffix from the compressed file name) and do not restore the original
time stamp if present (copy it from the compressed file). This option is the default when decompressing.
压缩时,默认情况下不要保存原始文件名和时间戳。(如果必须截断名称,则始终保存原始名称。)解压缩时,如果存在原始文件名,
请不要还原(仅从压缩文件名中删除gzip后缀),如果存在,请不要还原原始时间戳(从压缩文件中复制)。此选项是解压缩时的默认值。
When compressing, do not save the original file name and time stamp by default. (The original name is always saved if the name had to be truncated.) When
decompressing, do not restore the original file name if present (remove only the gzip suffix from the compressed file name) and do not restore the original
time stamp if present (copy it from the compressed file). This option is the default when decompressing.
压缩时,默认情况下不要保存原始文件名和时间戳。(如果必须截断名称,则始终保存原始名称。)解压缩时,如果存在原始文件名,
请不要还原(仅从压缩文件名中删除gzip后缀),如果存在,请不要还原原始时间戳(从压缩文件中复制)。此选项是解压缩时的默认值。
-N --name
When compressing, always save the original file name and time stamp; this is the default. When decompressing, restore the original file name and time stamp
if present. This option is useful on systems which have a limit on file name length or when the time stamp has been lost after a file transfer.
压缩时,始终保存原始文件名和时间戳;这是默认值。解压缩时,如果存在原始文件名和时间戳,请将其还原。对于文件名长度有限制或文件传输后时间戳丢失的系统,此选项非常有用。
When compressing, always save the original file name and time stamp; this is the default. When decompressing, restore the original file name and time stamp
if present. This option is useful on systems which have a limit on file name length or when the time stamp has been lost after a file transfer.
压缩时,始终保存原始文件名和时间戳;这是默认值。解压缩时,如果存在原始文件名和时间戳,请将其还原。对于文件名长度有限制或文件传输后时间戳丢失的系统,此选项非常有用。
-q --quiet
Suppress all warnings./删除所有警告。
Suppress all warnings./删除所有警告。
-r --recursive
Travel the directory structure recursively. If any of the file names specified on the command line are directories, gzip will descend into the directory and
compress all the files it finds there (or decompress them in the case of gunzip ).
递归地遍历目录结构。如果在命令行上指定的任何文件名是目录,gzip将下降到目录中并压缩在该目录中找到的所有文件(如果是gunzip,则解压缩这些文件)。
Travel the directory structure recursively. If any of the file names specified on the command line are directories, gzip will descend into the directory and
compress all the files it finds there (or decompress them in the case of gunzip ).
递归地遍历目录结构。如果在命令行上指定的任何文件名是目录,gzip将下降到目录中并压缩在该目录中找到的所有文件(如果是gunzip,则解压缩这些文件)。
-S .suf --suffix .suf
Use suffix .suf instead of .gz. Any suffix can be given, but suffixes other than .z and .gz should be avoided to avoid confusion when files are transferred
to other systems. A null suffix forces gunzip to try decompression on all given files regardless of suffix, as in:
-s.suf—后缀.suf
使用后缀.suf而不是.gz。可以给出任何后缀,但应避免.z和.gz以外的后缀,以避免在文件传输到其他系统时混淆。
空后缀强制gunzip尝试对所有给定文件进行解压缩,而不管后缀是什么,如:
Use suffix .suf instead of .gz. Any suffix can be given, but suffixes other than .z and .gz should be avoided to avoid confusion when files are transferred
to other systems. A null suffix forces gunzip to try decompression on all given files regardless of suffix, as in:
-s.suf—后缀.suf
使用后缀.suf而不是.gz。可以给出任何后缀,但应避免.z和.gz以外的后缀,以避免在文件传输到其他系统时混淆。
空后缀强制gunzip尝试对所有给定文件进行解压缩,而不管后缀是什么,如:
gunzip -S "" * (*.* for MSDOS)
Previous versions of gzip used the .z suffix. This was changed to avoid a conflict with pack(1).
以前的gzip版本使用了.z后缀。这是为了避免与块(1)发生冲突而更改的。
以前的gzip版本使用了.z后缀。这是为了避免与块(1)发生冲突而更改的。
-t --test
Test. Check the compressed file integrity./测试。检查压缩文件的完整性。
Test. Check the compressed file integrity./测试。检查压缩文件的完整性。
-v --verbose/输出详细调试信息
Verbose. Display the name and percentage reduction for each file compressed or decompressed./显示压缩或解压缩的每个文件的名称和减少百分比。
Verbose. Display the name and percentage reduction for each file compressed or decompressed./显示压缩或解压缩的每个文件的名称和减少百分比。
-V --version/版本
Version. Display the version number and compilation options then quit./显示版本号和编译选项,然后退出
Version. Display the version number and compilation options then quit./显示版本号和编译选项,然后退出
-# --fast --best/快,好的
Regulate the speed of compression using the specified digit #, where -1 or --fast indicates the fastest compression method (less compression) and -9 or
--best indicates the slowest compression method (best compression). The default compression level is -6 (that is, biased towards high compression at
expense of speed).
使用指定的数字调整压缩速度,其中-1或--fast表示最快的压缩方法(较少的压缩),
-9或--best表示最慢的压缩方法(最好的压缩)。默认的压缩级别是-6(即,以牺牲速度偏向于高压缩)。
Regulate the speed of compression using the specified digit #, where -1 or --fast indicates the fastest compression method (less compression) and -9 or
--best indicates the slowest compression method (best compression). The default compression level is -6 (that is, biased towards high compression at
expense of speed).
使用指定的数字调整压缩速度,其中-1或--fast表示最快的压缩方法(较少的压缩),
-9或--best表示最慢的压缩方法(最好的压缩)。默认的压缩级别是-6(即,以牺牲速度偏向于高压缩)。
ADVANCED USAGE/高级用法
Multiple compressed files can be concatenated. In this case, gunzip will extract all members at once. For example:
可以连接多个压缩文件。在这种情况下,Gunzip将立即提取所有成员。例如:
Multiple compressed files can be concatenated. In this case, gunzip will extract all members at once. For example:
可以连接多个压缩文件。在这种情况下,Gunzip将立即提取所有成员。例如:
gzip -c file1 > foo.gz
gzip -c file2 >> foo.gz
gzip -c file2 >> foo.gz
Then
gunzip -c foo
is equivalent to
cat file1 file2
In case of damage to one member of a .gz file, other members can still be recovered (if the damaged member is removed). However, you can get better compression by
compressing all members at once:
如果.gz文件中的一个成员损坏,其他成员仍可以恢复(如果已删除损坏的成员)。但是,通过一次压缩所有成员,可以获得更好的压缩效果:
compressing all members at once:
如果.gz文件中的一个成员损坏,其他成员仍可以恢复(如果已删除损坏的成员)。但是,通过一次压缩所有成员,可以获得更好的压缩效果:
cat file1 file2 | gzip > foo.gz
compresses better than
gzip -c file1 file2 > foo.gz
If you want to recompress concatenated files to get better compression, do:/如果要重新压缩连接的文件以获得更好的压缩,请执行以下操作:
gzip -cd old.gz | gzip > new.gz
If a compressed file consists of several members, the uncompressed size and CRC reported by the --list option applies to the last member only. If you need the
uncompressed size for all members, you can use:
如果压缩文件由多个成员组成,那么--list选项报告的未压缩大小和CRC仅适用于最后一个成员。如果需要所有成员的未压缩大小,可以使用:
uncompressed size for all members, you can use:
如果压缩文件由多个成员组成,那么--list选项报告的未压缩大小和CRC仅适用于最后一个成员。如果需要所有成员的未压缩大小,可以使用:
gzip -cd file.gz | wc -c
If you wish to create a single archive file with multiple members so that members can later be extracted independently, use an archiver such as tar or zip. GNU tar
supports the -z option to invoke gzip transparently. gzip is designed as a complement to tar, not as a replacement.
如果希望创建一个包含多个成员的单个存档文件,以便以后可以独立提取成员,请使用tar或zip等存档程序。gnu tar支持-z选项以透明地调用gzip。gzip是对tar的补充,而不是替代品。
supports the -z option to invoke gzip transparently. gzip is designed as a complement to tar, not as a replacement.
如果希望创建一个包含多个成员的单个存档文件,以便以后可以独立提取成员,请使用tar或zip等存档程序。gnu tar支持-z选项以透明地调用gzip。gzip是对tar的补充,而不是替代品。
ENVIRONMENT/环境
The environment variable GZIP can hold a set of default options for gzip. These options are interpreted first and can be overwritten by explicit command line
parameters. For example:
for sh: GZIP="-8v --name"; export GZIP
for csh: setenv GZIP "-8v --name"
for MSDOS: set GZIP=-8v --name
环境变量gzip可以保存一组gzip的默认选项。这些选项首先被解释,并且可以被显式的命令行参数覆盖。
例如:
对于sh:gzip=“-8v--name”;导出gzip
对于csh:setenv gzip“-8v--名称”
对于msdos:set gzip=-8v--名称
The environment variable GZIP can hold a set of default options for gzip. These options are interpreted first and can be overwritten by explicit command line
parameters. For example:
for sh: GZIP="-8v --name"; export GZIP
for csh: setenv GZIP "-8v --name"
for MSDOS: set GZIP=-8v --name
环境变量gzip可以保存一组gzip的默认选项。这些选项首先被解释,并且可以被显式的命令行参数覆盖。
例如:
对于sh:gzip=“-8v--name”;导出gzip
对于csh:setenv gzip“-8v--名称”
对于msdos:set gzip=-8v--名称
On Vax/VMS, the name of the environment variable is GZIP_OPT, to avoid a conflict with the symbol set for invocation of the program.
在VAX/VMS上,环境变量的名称是gzip_opt,以避免与用于调用程序的符号集发生冲突。
在VAX/VMS上,环境变量的名称是gzip_opt,以避免与用于调用程序的符号集发生冲突。
SEE ALSO/参见
znew(1), zcmp(1), zmore(1), zforce(1), gzexe(1), zip(1), unzip(1), compress(1), pack(1), compact(1)
znew(1), zcmp(1), zmore(1), zforce(1), gzexe(1), zip(1), unzip(1), compress(1), pack(1), compact(1)
The gzip file format is specified in P. Deutsch, GZIP file format specification version 4.3, <ftp://ftp.isi.edu/in-notes/rfc1952.txt>, Internet RFC 1952 (May
1996). The zip deflation format is specified in P. Deutsch, DEFLATE Compressed Data Format Specification version 1.3, <ftp://ftp.isi.edu/in-notes/rfc1951.txt>,
Internet RFC 1951 (May 1996).
znew(1), zcmp(1), zmore(1), zforce(1), gzexe(1), zip(1), unzip(1), compress(1), pack(1), compact(1)
gzip文件格式在p.deutsch,gzip文件格式规范版本4.3中指定,<ftp://ftp.isi.edu/in notes/rfc1952.txt>,internet rfc 1952(1996年5月)。
zip压缩格式在p.deutsch,deflate compressed data format specification version 1.3中指定,
<ftp://ftp.isi.edu/in notes/rfc1951.txt>,internet rfc 1951(1996年5月)。
1996). The zip deflation format is specified in P. Deutsch, DEFLATE Compressed Data Format Specification version 1.3, <ftp://ftp.isi.edu/in-notes/rfc1951.txt>,
Internet RFC 1951 (May 1996).
znew(1), zcmp(1), zmore(1), zforce(1), gzexe(1), zip(1), unzip(1), compress(1), pack(1), compact(1)
gzip文件格式在p.deutsch,gzip文件格式规范版本4.3中指定,<ftp://ftp.isi.edu/in notes/rfc1952.txt>,internet rfc 1952(1996年5月)。
zip压缩格式在p.deutsch,deflate compressed data format specification version 1.3中指定,
<ftp://ftp.isi.edu/in notes/rfc1951.txt>,internet rfc 1951(1996年5月)。
DIAGNOSTICS/诊断模式
Exit status is normally 0; if an error occurs, exit status is 1. If a warning occurs, exit status is 2.
退出状态通常为0;如果发生错误,则退出状态为1。如果出现警告,则退出状态为2。
Exit status is normally 0; if an error occurs, exit status is 1. If a warning occurs, exit status is 2.
退出状态通常为0;如果发生错误,则退出状态为1。如果出现警告,则退出状态为2。
Usage: gzip [-cdfhlLnNrtvV19] [-S suffix] [file ...]
Invalid options were specified on the command line.
用法:gzip[-cdfhlnnrtvvv19][-s suffix][file…]在命令行上指定了无效选项。
Invalid options were specified on the command line.
用法:gzip[-cdfhlnnrtvvv19][-s suffix][file…]在命令行上指定了无效选项。
file: not in gzip format
The file specified to gunzip has not been compressed.
文件:不是gzip格式,指定给gunzip的文件尚未压缩。
The file specified to gunzip has not been compressed.
文件:不是gzip格式,指定给gunzip的文件尚未压缩。
file: Corrupt input. Use zcat to recover some data.
The compressed file has been damaged. The data up to the point of failure can be recovered using
文件:输入损坏。使用zcat恢复一些数据。压缩文件已损坏。到故障点的数据可以使用
The compressed file has been damaged. The data up to the point of failure can be recovered using
文件:输入损坏。使用zcat恢复一些数据。压缩文件已损坏。到故障点的数据可以使用
zcat file > recover
file: compressed with xx bits, can only handle yy bits
File was compressed (using LZW) by a program that could deal with more bits than the decompress code on this machine. Recompress the file with gzip, which
compresses better and uses less memory.
文件:用XX位压缩,只能处理YY位文件被压缩(使用LZW)的程序,可以处理比这台机器上的解压缩代码更多的位。
使用gzip重新压缩文件,其中压缩效果更好,占用的内存更少。
File was compressed (using LZW) by a program that could deal with more bits than the decompress code on this machine. Recompress the file with gzip, which
compresses better and uses less memory.
文件:用XX位压缩,只能处理YY位文件被压缩(使用LZW)的程序,可以处理比这台机器上的解压缩代码更多的位。
使用gzip重新压缩文件,其中压缩效果更好,占用的内存更少。
file: already has .gz suffix -- no change/文件:已经有.gz后缀--没有更改
The file is assumed to be already compressed. Rename the file and try again.
假定文件已被压缩。重命名文件,然后重试。
The file is assumed to be already compressed. Rename the file and try again.
假定文件已被压缩。重命名文件,然后重试。
file already exists; do you wish to overwrite (y or n)?/文件已存在;是否要覆盖(Y或N)?
Respond "y" if you want the output file to be replaced; "n" if not.
如果要替换输出文件,请响应“Y”;否则,请响应“N”。
Respond "y" if you want the output file to be replaced; "n" if not.
如果要替换输出文件,请响应“Y”;否则,请响应“N”。
gunzip: corrupt input/GunZip:输入损坏
A SIGSEGV violation was detected which usually means that the input file has been corrupted.
检测到SIGSEGV冲突,这通常意味着输入文件已损坏。
A SIGSEGV violation was detected which usually means that the input file has been corrupted.
检测到SIGSEGV冲突,这通常意味着输入文件已损坏。
xx.x% Percentage of the input saved by compression.
(Relevant only for -v and -l.)
压缩保存的输入百分比。(仅适用于-v和-l。)
(Relevant only for -v and -l.)
压缩保存的输入百分比。(仅适用于-v和-l。)
-- not a regular file or directory: ignored/不是常规文件或目录:已忽略
When the input file is not a regular file or directory, (e.g. a symbolic link, socket, FIFO, device file), it is left unaltered.
当输入文件不是常规文件或目录(例如符号链接、套接字、FIFO、设备文件)时,它将保持不变。
When the input file is not a regular file or directory, (e.g. a symbolic link, socket, FIFO, device file), it is left unaltered.
当输入文件不是常规文件或目录(例如符号链接、套接字、FIFO、设备文件)时,它将保持不变。
-- has xx other links: unchanged/有XX个其他链接:未更改
The input file has links; it is left unchanged. See ln(1) for more information. Use the -f flag to force compression of multiply-linked files.
输入文件有链接;保持不变。更多信息请参见第(1)行。使用-f标志强制压缩多重链接文件。
The input file has links; it is left unchanged. See ln(1) for more information. Use the -f flag to force compression of multiply-linked files.
输入文件有链接;保持不变。更多信息请参见第(1)行。使用-f标志强制压缩多重链接文件。
CAVEATS\警告
When writing compressed data to a tape, it is generally necessary to pad the output with zeroes up to a block boundary. When the data is read and the whole block
is passed to gunzip for decompression, gunzip detects that there is extra trailing garbage after the compressed data and emits a warning by default. You have to
use the --quiet option to suppress the warning. This option can be set in the GZIP environment variable as in:
将压缩数据写入磁带时,通常需要用零填充输出到块边界。当读取数据并将整个块传递给gunzip进行解压时,gunzip检测到压缩数据后有额外的尾随垃圾,并默认发出警告。
您必须使用--quiet选项来抑制警告。可以在gzip环境变量中设置此选项,如下所示:
for sh: GZIP="-q" tar -xfz --block-compress /dev/rst0
for csh: (setenv GZIP -q; tar -xfz --block-compr /dev/rst0
对于sh:gzip=“-q” tar -xfz --block-compress /dev/rst0
对于CSH:(setenv gzip-q;tar -xfz --block-compr /dev/rst0
When writing compressed data to a tape, it is generally necessary to pad the output with zeroes up to a block boundary. When the data is read and the whole block
is passed to gunzip for decompression, gunzip detects that there is extra trailing garbage after the compressed data and emits a warning by default. You have to
use the --quiet option to suppress the warning. This option can be set in the GZIP environment variable as in:
将压缩数据写入磁带时,通常需要用零填充输出到块边界。当读取数据并将整个块传递给gunzip进行解压时,gunzip检测到压缩数据后有额外的尾随垃圾,并默认发出警告。
您必须使用--quiet选项来抑制警告。可以在gzip环境变量中设置此选项,如下所示:
for sh: GZIP="-q" tar -xfz --block-compress /dev/rst0
for csh: (setenv GZIP -q; tar -xfz --block-compr /dev/rst0
对于sh:gzip=“-q” tar -xfz --block-compress /dev/rst0
对于CSH:(setenv gzip-q;tar -xfz --block-compr /dev/rst0
In the above example, gzip is invoked implicitly by the -z option of GNU tar. Make sure that the same block size (-b option of tar) is used for reading and writing
compressed data on tapes. (This example assumes you are using the GNU version of tar.)
在上面的示例中,gzip由gnu tar的-z选项隐式调用。确保在磁带上读取和写入压缩数据时使用相同的块大小(tar的-b选项)。(此示例假设您使用的是GNU版本的tar。)
compressed data on tapes. (This example assumes you are using the GNU version of tar.)
在上面的示例中,gzip由gnu tar的-z选项隐式调用。确保在磁带上读取和写入压缩数据时使用相同的块大小(tar的-b选项)。(此示例假设您使用的是GNU版本的tar。)
BUGS\漏洞
The gzip format represents the the input size modulo 2^32, so the --list option reports incorrect uncompressed sizes and compression ratios for uncompressed files
4 GB and larger. To work around this problem, you can use the following command to discover a large uncompressed file?. true size:
gzip格式表示输入大小模块2^32,因此--list选项报告了不正确的未压缩大小和4 GB及更大的未压缩文件的压缩比。
为了解决这个问题,您可以使用以下命令发现一个大的未压缩文件?真实尺寸:
The gzip format represents the the input size modulo 2^32, so the --list option reports incorrect uncompressed sizes and compression ratios for uncompressed files
4 GB and larger. To work around this problem, you can use the following command to discover a large uncompressed file?. true size:
gzip格式表示输入大小模块2^32,因此--list选项报告了不正确的未压缩大小和4 GB及更大的未压缩文件的压缩比。
为了解决这个问题,您可以使用以下命令发现一个大的未压缩文件?真实尺寸:
zcat file.gz | wc -c
The --list option reports sizes as -1 and crc as ffffffff if the compressed file is on a non seekable media.
如果压缩文件在不可查找的媒体上,那么--list选项将大小报告为-1,将crc报告为ffffffff。
如果压缩文件在不可查找的媒体上,那么--list选项将大小报告为-1,将crc报告为ffffffff。
In some rare cases, the --best option gives worse compression than the default compression level (-6). On some highly redundant files, compress compresses better
than gzip.
在一些罕见的情况下,--best选项提供比默认压缩级别更差的压缩(-6)。在一些高度冗余的文件上,压缩比gzip压缩更好。
than gzip.
在一些罕见的情况下,--best选项提供比默认压缩级别更差的压缩(-6)。在一些高度冗余的文件上,压缩比gzip压缩更好。
COPYRIGHT NOTICE/版权声明
Copyright 漏 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
Copyright 漏 1992, 1993 Jean-loup Gailly
版权1998、1999、2001、2002自由软件基金会
Copyright 漏 1992, 1993 Jean-loup Gailly
Copyright 漏 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
Copyright 漏 1992, 1993 Jean-loup Gailly
版权1998、1999、2001、2002自由软件基金会
Copyright 漏 1992, 1993 Jean-loup Gailly
Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies.
如果版权声明和本许可声明保留在所有副本上,则允许制作和分发本手册的逐字副本。
如果版权声明和本许可声明保留在所有副本上,则允许制作和分发本手册的逐字副本。
Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived
work is distributed under the terms of a permission notice identical to this one.
允许在逐字复制的条件下复制和分发本手册的修改版本,前提是根据与本手册相同的许可通知条款分发整个派生作品。
work is distributed under the terms of a permission notice identical to this one.
允许在逐字复制的条件下复制和分发本手册的修改版本,前提是根据与本手册相同的许可通知条款分发整个派生作品。
Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that this
permission notice may be stated in a translation approved by the Foundation.
在上述修改版本的条件下,许可证可以将本手册的翻译复制和分发到另一种语言中,只是该许可通知可以在基金会批准的译文中陈述。
permission notice may be stated in a translation approved by the Foundation.
在上述修改版本的条件下,许可证可以将本手册的翻译复制和分发到另一种语言中,只是该许可通知可以在基金会批准的译文中陈述。
local GZIP(1)