⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gzip.tex

📁 GNU 系统开发的基于Iz77语法的压缩 学习lz77压缩算法 
💻 TEX
字号:
\input texinfo @c -*-texinfo-*-@c %**start of header@setfilename gzip.info@settitle Gzip User's Manual@finalout@setchapternewpage odd@c %**end of header@ifinfoThis file documents the the GNU @code{gzip} command for compressing files.Copyright (C) 1992-1993 Jean-loup GaillyPermission is granted to make and distribute verbatim copies ofthis manual provided the copyright notice and this permission noticeare preserved on all copies.@ignorePermission is granted to process this file through TeX and print theresults, provided the printed document carries copying permissionnotice identical to this one except for the removal of this paragraph(this paragraph not being relevant to the printed manual).@end ignorePermission is granted to copy and distribute modified versions of thismanual under the conditions for verbatim copying, provided that the entireresulting derived work is distributed under the terms of a permissionnotice identical to this one.Permission is granted to copy and distribute translations of this manualinto another language, under the above conditions for modified versions,except that this permission notice may be stated in a translation approvedby the Foundation.@end ifinfo@titlepage@title gzip@subtitle The data compression program@subtitle Edition 1.0.7, for Gzip Version 1.0.7@subtitle March 1993@author by Jean-loup Gailly@page@vskip 0pt plus 1filllCopyright @copyright{} 1992-1993 Jean-loup GaillyPermission is granted to make and distribute verbatim copies ofthis manual provided the copyright notice and this permission noticeare preserved on all copies.Permission is granted to copy and distribute modified versions of thismanual under the conditions for verbatim copying, provided that the entireresulting derived work is distributed under the terms of a permissionnotice identical to this one.Permission is granted to copy and distribute translations of this manualinto another language, under the above conditions for modified versions,except that this permission notice may be stated in a translation approvedby the Foundation.@end titlepage@node Top, , , (dir)@ifinfoThis file documents the @code{gzip} command to compress files.@end ifinfo@menu* Copying::		How you can copy and share @code{gzip}.* Overview::		Preliminary information.* Sample::		Sample output from @code{gzip}.* Invoking gzip::	How to run @code{gzip}.* Advanced usage::	Concatenated files.* Environment::		The @code{GZIP} environment variable* Problems::		Reporting bugs.* Concept Index::	Index of concepts.@end menu@node Copying, Overview, , Top@include gpl.texinfo@node Overview, Sample, Copying, Top@chapter Overview@cindex overview@code{Gzip} reduces the size of the named files using Lempel-Ziv coding(LZ77).  Whenever possible, each file is replaced by one with theextension ".z", while keeping the same ownership modes, access andmodification times.  (The extension is "-z" for VMS, "z" for MSDOS, OS/2and Atari.)  If no files are specified, the standard input is compressedto the standard output. If the new file name is too long, @code{gzip}truncates it and keeps the original file name in the compressed file.@code{gzip} will only attempt to compress regular files.  In particular,it will ignore symbolic links.Compressed files can be restored to their original form using"@code{gzip} -d" or @code{gunzip} or @code{zcat}.@code{gunzip} takes a list of files on its command line and replaceseach file whose name ends with ".z" or ".Z" and which begins with thecorrect magic number with an uncompressed file without the originalextension.  @code{gunzip} also recognizes the special extensions ".tgz"and ".taz" as shorthands for ".tar.z" or ".tar.Z".@code{gunzip} can currently decompress files created by @code{gzip},@code{zip}, @code{compress} or @code{pack}. The detection of the inputformat is automatic.  When using the first two formats, @code{gunzip}checks a 32 bit CRC (cyclic redundancy check). For @code{pack},@code{gunzip} checks the uncompressed length. The @code{compress}format was not designed to allow consistency checks. However @code{gunzip}is sometimes able to detect a bad .Z file. If you get an errorwhen uncompressing a .Z file, do not assume that the .Z file iscorrect simply because the standard @code{uncompress} does not complain.This generally means that the standard @code{uncompress} does not check itsinput, and happily generates garbage output.Files created by @code{zip} can be uncompressed by @code{gzip} only ifthey have a single member compressed with the 'deflation' method. Thisfeature is only intended to help conversion of @code{tar.zip} files tothe @code{tar.z} format. To extract @code{zip} files with severalmembers, use @code{unzip} instead of @code{gunzip}.@code{zcat} is identical to "@code{gunzip} -c".  @code{zcat}uncompresses either a list of files on the command line or its standardinput and writes the uncompressed data on standard output.  @code{zcat}will uncompress files that have the correct magic number whether theyhave a ".z" suffix or not.@code{gzip} uses the Lempel-Ziv algorithm used in @code{zip} and PKZIP.The amount of compression obtained depends on the size of the input andthe distribution of common substrings.  Typically, text such as sourcecode or English is reduced by 60-70%.  Compression is generally muchbetter than that achieved by LZW (as used in @code{compress}), Huffmancoding (as used in @code{pack}), or adaptive Huffman coding(@code{compact}).Compression is always performed, even if the compressed file is slightlylarger than the original. The worst case expansion is a few bytes forthe gzip file header, plus 5 bytes every 32K block, or an expansionratio of 0.015% for large files.  @code{gzip} preserves the mode,ownership and timestamps of files when compressing or decompressing.@node Sample, Invoking gzip, Overview, Top@chapter Sample Output@cindex sampleHere are some realistic examples of running @code{gzip}.This is the output of the command @samp{gzip}:@exampleusage: gzip [-cdfhLrv19] [file ...]For more help, type: gzip -h@end exampleThis is the output of the command @samp{gzip -h}:@examplegzip 1.0.7 (18 Mar 93)usage: gzip [-cdfhLrtvV19] [file ...] -c --stdout      write on standard output, keep original files unchanged -d --decompress  decompress -f --force       force overwrite of output file and compress links -h --help        give this help -L --license     display software license -q --quiet       suppress all warnings -r --recurse     recurse through directories -t --test        test compressed file integrity (implies -d) -v --verbose     verbose mode -V --version     display version number -1 --fast        compress faster -9 --best        compress better file...          files to (de)compress. If none given, use standard input@end exampleThis is the output of the command @samp{gzip -v gzip.c}:@examplegzip.c:                 69.8% -- replaced with gzip.c.z@end example@node Invoking gzip, Advanced usage, Sample, Top@chapter Invoking @code{gzip}@cindex invoking@cindex optionsThe format for running the @code{gzip} program is:@examplegzip @var{option} @dots{}@end example@code{gzip} supports the following options:@table @samp@item --help@itemx -hPrint an informative help message describing the options.@item --stdout@itemx -cWrite output on standard output; keep original files unchanged.If there are several input files, the output consists of a sequence ofindependently compressed members. To obtain better compression,concatenate all input files before compressing them.@item --decompress@itemx -dDecompress.@item --force@itemx -fForce compression or decompression even if the file has multiple linksor the corresponding file already exists. If -f is not given, andwhen not running in the background, @code{gzip} prompts to verifywhether an existing file should be overwritten.@item --help@itemx -hDisplay a help screen.@item --license@itemx -LDisplay the @code{gzip} license.@item --recurse@itemx -rTravel the directory structure recursively. If any of the file namesspecified on the command line are directories, @code{gzip} will descendinto the directory and compress all the files it finds there (ordecompress them in the case of @code{gunzip}).@item --test@itemx -tTest. Check the compressed file integrity.@item --verbose@itemx -vVerbose. Display the name and percentage reduction for each file compressed.@item --version@itemx -VVersion. Display the version number and compilation options.@item --fast@itemx --best@itemx -#Regulate the speed of compression using the specified digit #, where -1or --fast indicates the fastest compression method (less compression)and --best or -9 indicates the slowest compression method (optimalcompression).  The default compression level is -5.@end table@node Advanced usage, Environment, Invoking gzip, Top@chapter Advanced usage@cindex concatenated filesMultiple compressed files can be concatenated. In this case,@code{gunzip} will extract all members at once. If one member isdamaged, other members might still be recovered after removal of thedamaged member. Better compression can be usually obtained if allmembers are decompressed then recompressed in a single step.This is an example of concatenating gzip files:@examplegzip -c file1  > foo.zgzip -c file2 >> foo.z@end exampleThen@examplegunzip -c foo@end exampleis equivalent to@examplecat file1 file2@end exampleIn case of damage to one member of a .z file, other members canstill be recovered (if the damaged member is removed). However,you can get better compression by compressing all members at once:@examplecat file1 file2 | gzip > foo.z@end examplecompresses better than@examplegzip -c file1 file2 > foo.z@end exampleIf you want to recompress concatenated files to get better compression, do:@examplezcat old.z | gzip > new.z@end example@node Environment, Problems, Advanced usage, Top@chapter Environment@cindex EnvironmentThe environment variable @code{GZIP} can hold a set of default options forgzip.  These options are interpreted first and can be overwritten byexplicit command line parameters.  For example:@examplefor sh:    GZIP="-8 -v"; export GZIPfor csh:   setenv GZIP "-8 -v"for MSDOS: set GZIP=-8 -v@end exampleOn Vax/VMS, the name of the environment variable is @code{GZIP_OPT}, toavoid a conflict with the symbol set for invocation of the program.@node Problems, Concept Index, Environment, Top@chapter Reporting Bugs@cindex bugsIf you find a bug in @code{gzip}, please send electronic mail to@w{@samp{jloup@@chorus.fr}} or, if this fails, to@w{@samp{bug-gnu-utils@@prep.ai.mit.edu}}.  Include the version number,which you can find by running @w{@samp{gzip -V}}.  Also include in yourmessage the hardware and operating system, the compiler used to compile,a description of the bug behavior, and the input to gzip that triggeredthe bug.@refill@node Concept Index, , Problems, Top@unnumbered Concept Index@printindex cp@shortcontents@contents@bye

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -