自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

gzip 中文man頁面

系統(tǒng)
Gzip 采用Lempel-Ziv 編碼算法(LZ77)壓縮給定文件的大小。在可能的情況下, 每個文件被具有擴展名 .gz, 的文件所替換, 同時保留原屬主狀態(tài),存取和修改時間 (在VMS系統(tǒng)下缺省擴展名為 -gz 在MSDOS、OS/2 FAT, Windows NT FAT 和Atari系統(tǒng)下,缺省擴展名為 z ) 如果未指定文件名,或者指定了一個名為"-"的文件名,則從標準輸入讀取數(shù)據(jù),壓縮的結(jié)果輸出到標準輸出。 Gzip 只嘗試壓縮常規(guī)文件,特別地,它將忽略符號連接。

命令名

gzip, gunzip, zcat - 壓縮或展開文件 

總攬

gzip [ -acdfhlLnNrtvV19 ] [-S 后綴] [ 文件名 ... ]
gunzip [ -acfhlLnNrtvV ] [-S 后綴] [ 文件名 ... ]
zcat [ -fhLV ] [ 文件名 ...

描述

Gzip 采用Lempel-Ziv 編碼算法(LZ77)壓縮給定文件的大小。在可能的情況下, 每個文件被具有擴展名 .gz, 的文件所替換, 同時保留原屬主狀態(tài),存取和修改時間 (在VMS系統(tǒng)下缺省擴展名為 -gz 在MSDOS、OS/2 FAT, Windows NT FAT 和Atari系統(tǒng)下,缺省擴展名為 z ) 如果未指定文件名,或者指定了一個名為"-"的文件名,則從標準輸入讀取數(shù)據(jù),壓縮的結(jié)果輸出到標準輸出。 Gzip 只嘗試壓縮常規(guī)文件,特別地,它將忽略符號連接。

如果壓縮后的文件名對于所在的文件系統(tǒng)來說太長,
gzip 會將其截斷。 Gzip 只嘗試截斷文件名中大于3個字符的段(每個段由點分隔)。如果文件名只由較小的段組成,最長的段將被截斷。例如,如果文件名的長度限制是14個字符,文件gzip.msdos.exe 將被壓縮為gzi.msd.exe.gz。在沒有文件名長度限制的系統(tǒng)中,文件名將不會被截斷。
缺省情況下,
gzip 將原始文件名和時間信息保存在壓縮后的文件中。當采用 -N 選項解壓縮文件時,這些信息將被利用。在經(jīng)過文件傳輸后文件名被截斷及時間信息未被保留的情況下,這些信息將將用于恢復(fù)文件名及時間信息。
gzip -d 或者 gunzip 以及 zcat. 可以將壓縮后的文件恢復(fù)到原始的形式。如果保留在壓縮文件中的原始文件名不適合于當前的文件系統(tǒng),將根據(jù)原文件名新建一個合法的文件名。
gunzip
將命令行中以.gz, -gz, .z, -z, _z 或 .Z結(jié)尾并具有正確標志頭的文件解壓縮,并以去掉擴展名的解壓縮文件替換原文件。 gunzip 也能識別擴展名為 .tgz.taz 的文件,并將其分別當作 .tar.gz.tar.Z 的縮寫。在壓縮時,如果采用 .tar 擴展名則需要對文件名進行截斷處理時, gzip 將采用 .tgz 作為擴展名。
gunzip
目前能夠解壓由 gzip, zip, compress, compress -H 以及 pack 產(chǎn)生的文件。對輸入格式的檢測是自動的。當采用前兩種格式時, gunzip 檢查一個32位的CRC校驗碼。對于 pack, gunzip 則檢查壓縮前的數(shù)據(jù)長度。標準的 compress 格式的設(shè)計無法實現(xiàn)一致性檢查。但有時 gunzip 仍然能檢測到壞的.Z文件。如果你在解壓一個.Z文件時出現(xiàn)錯誤,不要簡單地因為標準的 uncompress 沒有報錯就認定.Z文件是正確的。這通常意味著標準的 uncompress 沒有檢查它的輸入數(shù)據(jù),而盲目地產(chǎn)生了錯誤的輸出。SCO的compress -H格式(lzh壓縮方法)不包含CRC校驗碼,但也允許一些一致性檢查。
zip 生成的文件, 如果其內(nèi)容只有一個文件并且是以'deflation'方式壓縮的,則可由gzip解壓。這一特性只是為了方便將tar.zip 格式的文件轉(zhuǎn)換為tar.gz格式而加入的。要解壓含有多個文件的zip文件,請用 unzip.
zcat
的功能與 gunzip -c. 相同。 (在一些系統(tǒng)中, zcat 可能被安裝成 gzcat 以保留 compress 與zcat的原有連接。) zcat 將命令行中列出的文件或由標準輸入輸入的數(shù)據(jù)解壓,解壓后的數(shù)據(jù)寫到標準輸出。 zcat 解壓具有正確標志頭的文件,而不管其是否帶有 .gz 后綴。
Gzip
采用 zip 和 PKZIP 中所采用的Lempel-Ziv算法。得到的壓縮比依賴于輸入數(shù)據(jù)的大小以及公用子串的分布。例如源程序和英文文檔能夠壓縮60-70%。壓縮比通常比LZW( compress 采用的算法)、Huffman編碼( pack 所采用的算法)、以及自適應(yīng)Huffman編碼( RI compact ) 等方法要好得多。
即使壓縮后的文件略大于原文件,壓縮也照樣進行。最壞的情況下,多出的數(shù)據(jù)包括
gzip文件頭中的若干個字節(jié),加上每塊32K的5個字節(jié),或者,對于大文件來說0.015% 的放大率。注意實際占用的硬盤塊數(shù)目幾乎從不增加。 gzip 在壓縮和解壓縮時保留原文件的屬主和時間信息。

選項

-a --ascii
Ascii文本模式:按本地習慣轉(zhuǎn)換行結(jié)束符。該選項僅在一些非Unix 系統(tǒng)上有效。對于MSDOS,在壓縮時CR LF(譯注:即回車和換行符)被轉(zhuǎn)換為LF,在解壓時LF被轉(zhuǎn)換為CR LF。
-c --stdout --to-stdout
將結(jié)果寫到標準輸出;原文件保持不變。如果有多個輸入文件,輸出將由一系列獨立的壓縮文件組成。如果想得到較好的壓縮率,在壓縮前應(yīng)將多個文件連在一起。
-d --decompress --uncompress
解壓縮。
-f --force
強制壓縮和解壓縮,即使指定文件具有多重連接,或相應(yīng)文件已經(jīng)存在,或壓縮數(shù)據(jù)來自或?qū)懲粋€終端。如果輸入數(shù)據(jù)是 gzip 無法識別的格式,同時在命令行中也給出了--stdout選項,gzip將把輸入數(shù)據(jù)拷貝至標準輸出而不做任何改動,就象cat所做的一樣。如果未給出 -f 選項,并且未在后臺運行, gzip 會提示用戶以確認是否覆蓋一個已存在的文件。
-h --help
顯示幫助信息然后退出。
-l --list
列出每個壓縮文件的如下項目:


    compressed size:  壓縮文件的長度
    uncompressed size:  壓縮前文件的長度
    ratio: 壓縮率(如果未知則為0.0%)
    uncompressed_name: 壓縮前的文件名

對于非gzip格式的文件,壓縮前文件長度顯示為-1,例如由compress壓縮的.Z文件。可用下列命令得到這種文件壓縮前的長度:


    zcat file.Z | wc -c

如果同時指定了--verbose選項,下列項目也被列出:


    method: 壓縮方式
    crc: 未壓縮數(shù)據(jù)的32位CRC校驗碼
    date & time: 壓縮前文件的時間信息

目前支持的壓縮方式有deflate、compress、lzh(SCO下的compress -H)以及pack等方式。對于非gzip格式的文件,crc校驗碼顯示為ffffffff。

若指定了--name選項,如果有的話,壓縮前文件名,日期以及時間是保存在壓縮文件中的內(nèi)容。

若指定了--verbose選項,還將列出所有文件的長度總和,除非某些文件的長度未知。若指定--quiet選項,將不顯示標題和合計兩行內(nèi)容。

-L --license
顯示 gzip 的許可證信息然后退出。
-n --no-name
在壓縮時,缺省不保留原始文件名和時間信息。(如果必須對文件名作截斷處理,則原始文件名總是被保存。) 在解壓縮時,即使有也不恢復(fù)原始文件名(僅將壓縮文件名中的 gzip 后綴去掉)和時間信息(拷貝壓縮文件中相應(yīng)信息)。該選項是壓縮時的缺省選項。
-N --name
在壓縮時總是保存原始文件名和時間信息;該選項為缺省選項。在解壓縮時,如果存在原始文件名和時間信息則恢復(fù)之。該選項可用于對文件名長度有限制的系統(tǒng),以及經(jīng)過文件傳輸后丟失時間信息的情況。
-q --quiet
壓制所有警告信息。
-r --recursive
遞歸地訪問目錄結(jié)構(gòu)。如果命令行中有目錄名, gzip 將進入目錄并壓縮所有找到的文件(如果執(zhí)行的命令是 gunzip 則對其解壓縮)。
-S .suf --suffix .suf
采用.suf后綴取代.gz后綴??梢灾付ㄈ魏魏缶Y,但應(yīng)避免使用除了.z和.gz以外的其它后綴,以免文件傳輸?shù)狡渌到y(tǒng)時發(fā)生混淆。一個空后綴將迫使gunzip 解壓縮所有文件而不管它具有什么樣的后綴,例如:


    gunzip -S "" *       (在MSDOS下用*.*替換*)

以前版本的gzip采用.z后綴。為了避免與 pack(1). 沖突,后來作了改動。

-t --test
測試。檢查壓縮文件的完整性。
-v --verbose
詳盡模式。顯示每個壓縮或解壓縮文件的名字和壓縮率。
-V --version
版本。顯示版本號和編譯選項后退出。 Version. Display the version number and compilation options then quit.
-# --fast --best
用指定的數(shù)字 # 調(diào)整壓縮速度,其中 -1--fast 對應(yīng)最快壓縮方式(壓縮率較低), -9--best 對應(yīng)最慢壓縮方式(壓縮率***)。缺省的壓縮級別為
- (也就是說,以速度為代價偏向于高壓縮率)。

高級用法

多個被壓縮的文件可以連在一起。在這種情況下, gunzip 能一次解壓所有文件。例如:


      gzip -c file1  > foo.gz
      gzip -c file2 >> foo.gz

然后
      gunzip -c foo

上面的命令等價于


      cat file1 file2

如果.gz文件中的某一個文件損壞,其他文件仍可以恢復(fù)(如果損壞的文件被刪除的話)。而且一次壓縮所有文件能得到較好的壓縮率:


      cat file1 file2 | gzip > foo.gz

上面用法的壓縮率比下面用法的高:


      gzip -c file1 file2 > foo.gz

如果想重新壓縮連接起來的文件以得到較高的壓縮率,可以用下面的命令:


      gzip -cd old.gz | gzip > new.gz

如果一個壓縮文件由多個文件組成,--list選項只能列出***一個成員的解壓后文件長度和CRC校驗碼。如果需要所有成員的解壓后文件長度,可用如下命令:


      gzip -cd file.gz | wc -c

如果想要產(chǎn)生一個具有多個成員的存檔文件,以便將來能夠獨立地取出其中的成員,可以用tar或zip這樣的歸檔軟件。GNU tar支持-z選項,可直接調(diào)用gzip。gzip設(shè)計為 tar的補充,而非它的取代物。  

環(huán)境變量

環(huán)境變量 GZIP 能夠控制一系列 gzip 的缺省選項。這些選項被首先解釋,并且能被命令行參數(shù)中的直接定義覆蓋。例如:
      在sh下:    GZIP="-8v --name"; export GZIP
      在csh下:   setenv GZIP "-8v --name"
      在MSDOS下: set GZIP=-8v --name

在Vax/VMS系統(tǒng)中,為了避免與調(diào)用該程序的符號設(shè)置沖突,該環(huán)境變量名為GZIP_OPT。  

另見

znew(1), zcmp(1), zmore(1), zforce(1), gzexe(1), zip(1), unzip(1), compress(1), pack(1), compact(1)  

#p#

NAME

gzip, gunzip, zcat - compress or expand files  

SYNOPSIS

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.

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 characters. (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 characters, 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.

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.

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.

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 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 simply 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.

Files created by zip can be uncompressed by gzip only if they have a single member compressed with the 'deflation' method. This feature is only intended to help conversion of tar.zip files to the tar.gz format. To extract zip files with several members, use unzip instead of 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.

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 substrings. 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 compress), Huffman coding (as used in pack), or adaptive Huffman coding (compact).

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. 

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.
-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 compressed members. To obtain better compression, concatenate all input files before compressing them.
-d --decompress --uncompress
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.
-h --help
Display a help screen and quit.
-l --list
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

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

In combination with the --verbose option, the following fields are also displayed:


    method: compression method
    crc: the 32-bit CRC of the uncompressed data
    date & time: time stamp for the uncompressed file

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 format.

With --name, the uncompressed name, date and time are those stored within the compress file if present.

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.

-L --license
Display the gzip license and quit.
-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.
-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.
-q --quiet
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 ).
-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:


    gunzip -S "" *       (*.* for MSDOS)

Previous versions of gzip used the .z suffix. This was changed to avoid a conflict with pack(1).

-t --test
Test. Check the compressed file integrity.
-v --verbose
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.
-# --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).

ADVANCED USAGE

Multiple compressed files can be concatenated. In this case, gunzip will extract all members at once. For example:


      gzip -c file1  > 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:


      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:


      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.  

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

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.  

SEE ALSO

znew(1), zcmp(1), zmore(1), zforce(1), gzexe(1), zip(1), unzip(1), compress(1), pack(1), compact(1)

責任編輯:韓亞珊 來源: CMPP.net
相關(guān)推薦

2011-08-15 10:21:09

man中文man

2011-08-24 16:48:36

man中文man

2011-08-11 16:11:49

at中文man

2011-08-25 10:21:56

man.conf中文man

2011-08-25 15:51:06

feof中文man

2011-08-24 17:30:25

reset中文man

2011-08-18 19:15:25

group中文man

2011-08-18 19:21:18

info中文man

2011-08-18 15:10:06

aliases中文man

2011-08-11 18:05:04

chvt中文man

2011-08-11 17:27:20

charset中文man

2011-08-11 18:13:07

clear中文man

2011-08-11 16:48:04

cal中文man

2011-08-11 17:16:43

cce中文man

2011-08-11 17:21:47

chattr中文man

2011-08-11 15:03:21

ACCESS中文man

2011-08-24 10:39:21

COMMIT中文man

2011-08-24 10:31:55

CLUSTER中文man

2011-08-24 10:11:43

bootparam中文man

2011-08-15 17:59:10

lha中文man
點贊
收藏

51CTO技術(shù)棧公眾號