161 lines
4.6 KiB
Groff
161 lines
4.6 KiB
Groff
.Dd June 19, 2010
|
|
.Dt PIGZ 1
|
|
.Os
|
|
.Sh NAME
|
|
.Nm pigz ,
|
|
.Nm unpigz
|
|
.Nd compress or expand files
|
|
.Sh SYNOPSIS
|
|
.Nm
|
|
.Op Fl 0..9cdfhiKkLlNnqRrTtz
|
|
.Op Fl b Ar blocksize
|
|
.Op Fl p Ar threads
|
|
.Op Fl S Ar suffix
|
|
.Op Ar
|
|
.Nm unpigz
|
|
.Op Fl cfhiKkLlNnqRrTtz
|
|
.Op Fl b Ar blocksize
|
|
.Op Fl p Ar threads
|
|
.Op Fl S Ar suffix
|
|
.Op Ar
|
|
.Sh DESCRIPTION
|
|
.Nm
|
|
compresses using threads to make use of multiple processors and cores.
|
|
The input is broken up into 128 KB chunks with each compressed in parallel.
|
|
The individual check value for each chunk is also calculated in parallel.
|
|
The compressed data is written in order to the output, and a combined check
|
|
value is calculated from the individual check values.
|
|
.Pp
|
|
The compressed data format generated is in the gzip, zlib, or single-entry
|
|
zip format using the deflate compression method. The compression produces
|
|
partial raw deflate streams which are concatenated by a single write thread
|
|
and wrapped with the appropriate header and trailer, where the trailer
|
|
contains the combined check value.
|
|
.Pp
|
|
Each partial raw deflate stream is terminated by an empty stored block
|
|
(using the
|
|
.Dv Z_SYNC_FLUSH
|
|
option of
|
|
.Xr zlib 3 ) ,
|
|
in order to end that partial bit stream at a byte boundary.
|
|
That allows the partial streams to be concatenated simply as sequences
|
|
of bytes.
|
|
This adds a very small four to five byte overhead to the output for
|
|
each input chunk.
|
|
.Pp
|
|
The default input block size is 128K, but can be changed with the
|
|
.Fl b
|
|
option.
|
|
The number of compress threads is set by default to the number
|
|
of online processors, which can be changed using the
|
|
.Fl p
|
|
option.
|
|
Specifying
|
|
.Fl p Ar 1
|
|
avoids the use of threads entirely.
|
|
.Pp
|
|
The input blocks, while compressed independently, have the last 32K of the
|
|
previous block loaded as a preset dictionary to preserve the compression
|
|
effectiveness of deflating in a single thread.
|
|
This can be turned off using the
|
|
.Fl i
|
|
or
|
|
.Fl Fl independent
|
|
option, so that the blocks can be decompressed
|
|
independently for partial error recovery or for random access.
|
|
.Pp
|
|
Decompression can't be parallelized, at least not without specially prepared
|
|
deflate streams for that purpose.
|
|
As a result,
|
|
.Nm
|
|
uses a single thread (the main thread) for decompression, but will
|
|
create three other threads for reading, writing, and check
|
|
calculation, which can speed up decompression under some
|
|
circumstances.
|
|
Parallel decompression can be turned off by specifying one process
|
|
.Fl ( dp Ar 1
|
|
or
|
|
.Fl tp Ar 1 ) .
|
|
.Pp
|
|
Compressed files can be restored to their original form using
|
|
.Nm pigz Fl d
|
|
or
|
|
.Nm unpigz .
|
|
.Sh OPTIONS
|
|
.Bl -tag -width XXiXXXindependentXX
|
|
.It Fl #, Fl Fl fast, Fl Fl best
|
|
Regulate the speed of compression using the specified digit
|
|
.Ar # ,
|
|
where
|
|
.Fl 1
|
|
or
|
|
.Fl Fl fast
|
|
indicates the fastest compression method (less compression)
|
|
and
|
|
.Fl 9
|
|
or
|
|
.Fl Fl best
|
|
indicates the slowest compression method (best compression).
|
|
Level 0 is no compression.
|
|
.It Fl b, Fl Fl blocksize Ar mmm
|
|
Set compression block size to
|
|
.Ar mmm
|
|
K (default 128KiB).
|
|
.It Fl c, Fl Fl stdout, Fl Fl to-stdout
|
|
Write all processed output to stdout (won't delete).
|
|
.It Fl d, Fl Fl decompress, Fl Fl uncompress
|
|
Decompress the compressed input.
|
|
.It Fl f, Fl Fl force
|
|
Force overwrite, compress .gz, links, and to terminal.
|
|
.It Fl h, Fl Fl help
|
|
Display a help screen and quit.
|
|
.It Fl i, Fl Fl independent
|
|
Compress blocks independently for damage recovery.
|
|
.It Fl K, Fl Fl zip
|
|
Compress to PKWare zip (.zip) single entry format.
|
|
.It Fl k, Fl Fl keep
|
|
Do not delete original file after processing.
|
|
.It Fl L, Fl Fl license
|
|
Display the
|
|
.Nm pigz
|
|
license and quit.
|
|
.It Fl l, Fl Fl list
|
|
List the contents of the compressed input.
|
|
.It Fl N, Fl Fl name
|
|
Store/restore file name and mod time in/from header.
|
|
.It Fl n, Fl Fl no-name
|
|
Do not store or restore file name in/from header.
|
|
.It Fl p, Fl Fl processes Ar n
|
|
Allow up to n processes (default is the number of online processors)
|
|
.It Fl q, Fl Fl quiet, Fl Fl silent
|
|
Print no messages, even on error.
|
|
.It Fl r, Fl Fl recursive
|
|
Process the contents of all subdirectories.
|
|
.It Fl S, Fl Fl suffix Ar .sss
|
|
Use suffix
|
|
.Ar .sss
|
|
instead of
|
|
.Pa .gz
|
|
(for compression).
|
|
.It Fl T, Fl Fl no-time
|
|
Do not store or restore mod time in/from header.
|
|
.It Fl t, Fl Fl test
|
|
Test the integrity of the compressed input.
|
|
.It Fl V, Fl Fl version
|
|
Show the version of pigz.
|
|
.It Fl v, Fl Fl verbose
|
|
Provide more verbose output.
|
|
.It Fl z, Fl Fl zlib
|
|
Compress to zlib
|
|
.Pq Pa .zz
|
|
instead of gzip format.
|
|
.El
|
|
.Sh COPYRIGHT NOTICE
|
|
This software is provided 'as-is', without any express or implied
|
|
warranty.
|
|
In no event will the author be held liable for any damages
|
|
arising from the use of this software.
|
|
.Pp
|
|
Copyright (C) 2007, 2008, 2009, 2010
|
|
.An Mark Adler Aq madler@alumni.caltech.edu
|