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

📄 manual.texi

📁 bzip2是一个免费的
💻 TEXI
📖 第 1 页 / 共 5 页
字号:
\input texinfo  @c                                  -*- Texinfo -*-@setfilename bzip2.info@ignoreThis file documents bzip2 version 1.0.2, and associated librarylibbzip2, written by Julian Seward (jseward@acm.org).Copyright (C) 1996-2002 Julian R SewardPermission 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 translations of this manualinto another language, under the above conditions for verbatim copies.@end ignore@ifinfo@formatSTART-INFO-DIR-ENTRY* Bzip2: (bzip2).		A program and library for data compression.END-INFO-DIR-ENTRY@end format@end ifinfo@iftex@c @finalout@settitle bzip2 and libbzip2@titlepage@title bzip2 and libbzip2@subtitle a program and library for data compression@subtitle copyright (C) 1996-2002 Julian Seward@subtitle version 1.0.2 of 30 December 2001@author Julian Seward@end titlepage@parindent 0mm@parskip 2mm@end iftex@node Top,,, (dir)The following text is the License for this software.  You shouldfind it identical to that contained in the file LICENSE in the source distribution.@bf{------------------ START OF THE LICENSE ------------------}This program, @code{bzip2}, and associated library @code{libbzip2}, areCopyright (C) 1996-2002 Julian R Seward.  All rights reserved.Redistribution and use in source and binary forms, with or withoutmodification, are permitted provided that the following conditionsare met:@itemize @bullet@item   Redistributions of source code must retain the above copyright   notice, this list of conditions and the following disclaimer.@item   The origin of this software must not be misrepresented; you must    not claim that you wrote the original software.  If you use this    software in a product, an acknowledgment in the product    documentation would be appreciated but is not required.@item   Altered source versions must be plainly marked as such, and must   not be misrepresented as being the original software.@item   The name of the author may not be used to endorse or promote    products derived from this software without specific prior written    permission.@end itemizeTHIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESSOR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIEDWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSEARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANYDIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIALDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTEGOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESSINTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDINGNEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THISSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.Julian Seward, Cambridge, UK.@code{jseward@@acm.org}@code{bzip2}/@code{libbzip2} version 1.0.2 of 30 December 2001.@bf{------------------ END OF THE LICENSE ------------------}Web sites:@code{http://sources.redhat.com/bzip2}@code{http://www.cacheprof.org}PATENTS: To the best of my knowledge, @code{bzip2} does not use any patentedalgorithms.  However, I do not have the resources available to carry outa full patent search.  Therefore I cannot give any guarantee of theabove statement.@chapter Introduction@code{bzip2}  compresses  files  using the Burrows-Wheeler block-sorting text compression algorithm,  and  Huffman  coding.Compression  is  generally  considerably  better than thatachieved by more conventional LZ77/LZ78-based compressors,and  approaches  the performance of the PPM family of statistical compressors.@code{bzip2} is built on top of @code{libbzip2}, a flexible libraryfor handling compressed data in the @code{bzip2} format.  This manualdescribes both how to use the program and how to work with the library interface.  Most of themanual is devoted to this library, not the program, which is good news if your interest is only in the program.Chapter 2 describes how to use @code{bzip2}; this is the only part you need to read if you just want to know how to operate the program.Chapter 3 describes the programming interfaces in detail, andChapter 4 records some miscellaneous notes which I thoughtought to be recorded somewhere.@chapter How to use @code{bzip2}This chapter contains a copy of the @code{bzip2} man page,and nothing else.@quotation@unnumberedsubsubsec NAME@itemize@item @code{bzip2}, @code{bunzip2}- a block-sorting file compressor, v1.0.2@item @code{bzcat} - decompresses files to stdout@item @code{bzip2recover}- recovers data from damaged bzip2 files@end itemize@unnumberedsubsubsec SYNOPSIS@itemize@item @code{bzip2} [ -cdfkqstvzVL123456789 ] [ filenames ...  ]@item @code{bunzip2} [ -fkvsVL ] [ filenames ...  ]@item @code{bzcat} [ -s ] [ filenames ...  ]@item @code{bzip2recover} filename@end itemize@unnumberedsubsubsec DESCRIPTION@code{bzip2} compresses files using the Burrows-Wheeler block sortingtext compression algorithm, and Huffman coding.  Compression isgenerally considerably better than that achieved by more conventionalLZ77/LZ78-based compressors, and approaches the performance of the PPMfamily of statistical compressors.The command-line options are deliberately very similar to those of GNU@code{gzip}, but they are not identical.@code{bzip2} expects a list of file names to accompany the command-lineflags.  Each file is replaced by a compressed version of itself, withthe name @code{original_name.bz2}.  Each compressed file has the samemodification date, permissions, and, when possible, ownership as thecorresponding original, so that these properties can be correctlyrestored at decompression time.  File name handling is naive in thesense that there is no mechanism for preserving original file names,permissions, ownerships or dates in filesystems which lack theseconcepts, or have serious file name length restrictions, such as MS-DOS.@code{bzip2} and @code{bunzip2} will by default not overwrite existingfiles.  If you want this to happen, specify the @code{-f} flag.If no file names are specified, @code{bzip2} compresses from standardinput to standard output.  In this case, @code{bzip2} will decline towrite compressed output to a terminal, as this would be entirelyincomprehensible and therefore pointless.@code{bunzip2} (or @code{bzip2 -d}) decompresses allspecified files.  Files which were not created by @code{bzip2}will be detected and ignored, and a warning issued.  @code{bzip2} attempts to guess the filename for the decompressed file from that of the compressed file as follows:@itemize@item @code{filename.bz2 } becomes @code{filename}@item @code{filename.bz  } becomes @code{filename}@item @code{filename.tbz2} becomes @code{filename.tar}@item @code{filename.tbz } becomes @code{filename.tar}@item @code{anyothername } becomes @code{anyothername.out}@end itemizeIf the file does not end in one of the recognised endings, @code{.bz2}, @code{.bz}, @code{.tbz2} or @code{.tbz}, @code{bzip2} complains that it cannotguess the name of the original file, and uses the original namewith @code{.out} appended.As with compression, supplying nofilenames causes decompression from standard input to standard output.@code{bunzip2} will correctly decompress a file which is theconcatenation of two or more compressed files.  The result is theconcatenation of the corresponding uncompressed files.  Integritytesting (@code{-t}) of concatenated compressed files is also supported.You can also compress or decompress files to the standard output bygiving the @code{-c} flag.  Multiple files may be compressed anddecompressed like this.  The resulting outputs are fed sequentially tostdout.  Compression of multiple files in this manner generates a streamcontaining multiple compressed file representations.  Such a streamcan be decompressed correctly only by @code{bzip2} version 0.9.0 orlater.  Earlier versions of @code{bzip2} will stop after decompressingthe first file in the stream.@code{bzcat} (or @code{bzip2 -dc}) decompresses all specified files tothe standard output.@code{bzip2} will read arguments from the environment variables@code{BZIP2} and @code{BZIP}, in that order, and will process thembefore any arguments read from the command line.  This gives a convenient way to supply default arguments.Compression is always performed, even if the compressed file is slightlylarger than the original.  Files of less than about one hundred bytestend to get larger, since the compression mechanism has a constantoverhead in the region of 50 bytes.  Random data (including the outputof most file compressors) is coded at about 8.05 bits per byte, givingan expansion of around 0.5%.As a self-check for your protection, @code{bzip2} uses 32-bit CRCs tomake sure that the decompressed version of a file is identical to theoriginal.  This guards against corruption of the compressed data, andagainst undetected bugs in @code{bzip2} (hopefully very unlikely).  Thechances of data corruption going undetected is microscopic, about onechance in four billion for each file processed.  Be aware, though, thatthe check occurs upon decompression, so it can only tell you thatsomething is wrong.  It can't help you recover the original uncompresseddata.  You can use @code{bzip2recover} to try to recover data fromdamaged files.Return values: 0 for a normal exit, 1 for environmental problems (filenot found, invalid flags, I/O errors, &c), 2 to indicate a corruptcompressed file, 3 for an internal consistency error (eg, bug) whichcaused @code{bzip2} to panic.@unnumberedsubsubsec OPTIONS@table @code@item -c  --stdoutCompress or decompress to standard output.@item -d  --decompressForce decompression.  @code{bzip2}, @code{bunzip2} and @code{bzcat} arereally the same program, and the decision about what actions to take isdone on the basis of which name is used.  This flag overrides thatmechanism, and forces bzip2 to decompress.@item -z --compressThe complement to @code{-d}: forces compression, regardless of theinvokation name.@item -t --testCheck integrity of the specified file(s), but don't decompress them.This really performs a trial decompression and throws away the result.@item -f --forceForce overwrite of output files.  Normally, @code{bzip2} will not overwriteexisting output files.  Also forces @code{bzip2} to break hard linksto files, which it otherwise wouldn't do.@code{bzip2} normally declines to decompress files which don't have thecorrect magic header bytes.  If forced (@code{-f}), however, it willpass such files through unmodified.  This is how GNU @code{gzip}behaves.@item -k --keepKeep (don't delete) input files during compressionor decompression.@item -s --smallReduce memory usage, for compression, decompression and testing.  Filesare decompressed and tested using a modified algorithm which onlyrequires 2.5 bytes per block byte.  This means any file can bedecompressed in 2300k of memory, albeit at about half the normal speed.During compression, @code{-s} selects a block size of 200k, which limitsmemory use to around the same figure, at the expense of your compressionratio.  In short, if your machine is low on memory (8 megabytes orless), use -s for everything.  See MEMORY MANAGEMENT below.@item -q --quietSuppress non-essential warning messages.  Messages pertaining toI/O errors and other critical events will not be suppressed.@item -v --verboseVerbose mode -- show the compression ratio for each file processed.Further @code{-v}'s increase the verbosity level, spewing out lots ofinformation which is primarily of interest for diagnostic purposes.@item -L --license -V --versionDisplay the software version, license terms and conditions.@item -1 (or --fast) to -9 (or --best)Set the block size to 100 k, 200 k ..  900 k when compressing.  Has noeffect when decompressing.  See MEMORY MANAGEMENT below.The @code{--fast} and @code{--best} aliases are primarily for GNU@code{gzip} compatibility.  In particular, @code{--fast} doesn't makethings significantly faster.  And @code{--best} merely selects thedefault behaviour.@item --Treats all subsequent arguments as file names, even if they startwith a dash.  This is so you can handle files with names beginningwith a dash, for example: @code{bzip2 -- -myfilename}.@item --repetitive-fast @item --repetitive-bestThese flags are redundant in versions 0.9.5 and above.  They providedsome coarse control over the behaviour of the sorting algorithm inearlier versions, which was sometimes useful.  0.9.5 and above have animproved algorithm which renders these flags irrelevant.@end table@unnumberedsubsubsec MEMORY MANAGEMENT@code{bzip2} compresses large files in blocks.  The block size affectsboth the compression ratio achieved, and the amount of memory needed for

⌨️ 快捷键说明

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