blob: 567c6caa4ad73be55504ddd15597ce570656dc23 [file] [log] [blame]
Dees_Troy51a0e822012-09-05 15:24:24 -04001.TH PIGZ 1 local
2.SH NAME
3pigz, unpigz \- compress or expand files
4.SH SYNOPSIS
5.ll +8
6.B pigz
7.RB [ " \-cdfhikKlLnNqrRtTz0..9 " ]
8[
9.B -b
10.I blocksize
11]
12[
13.B -p
14.I threads
15]
16[
17.B -S
18.I suffix
19]
20[
21.I "name \&..."
22]
23.ll -8
24.br
25.B unpigz
26.RB [ " \-cfhikKlLnNqrRtTz " ]
27[
28.B -b
29.I blocksize
30]
31[
32.B -p
33.I threads
34]
35[
36.B -S
37.I suffix
38]
39[
40.I "name \&..."
41]
42.SH DESCRIPTION
43.I Pigz
44compresses using threads to make use of multiple processors and cores.
45The input is broken up into 128 KB chunks with each compressed in parallel.
46The individual check value for each chunk is also calculated in parallel.
47The compressed data is written in order to the output, and a combined check
48value is calculated from the individual check values.
49.PP
50The compressed data format generated is in the gzip, zlib, or single-entry
51zip format using the deflate compression method. The compression produces
52partial raw deflate streams which are concatenated by a single write thread
53and wrapped with the appropriate header and trailer, where the trailer
54contains the combined check value.
55.PP
56Each partial raw deflate stream is terminated by an empty stored block
57(using the Z_SYNC_FLUSH option of zlib), in order to end that partial bit
58stream at a byte boundary. That allows the partial streams to be
59concatenated simply as sequences of bytes. This adds a very small four to
60five byte overhead to the output for each input chunk.
61.PP
62The default input block size is 128K, but can be changed with the
63.B -b
64option. The number of compress threads is set by default to the number
65of online processors,
66which can be changed using the
67.B -p
68option. Specifying
69.B -p 1
70avoids the use of threads entirely.
71.PP
72The input blocks, while compressed independently, have the last 32K of the
73previous block loaded as a preset dictionary to preserve the compression
74effectiveness of deflating in a single thread. This can be turned off using
75the
76.B -i
77or
78.B --independent
79option, so that the blocks can be decompressed
80independently for partial error recovery or for random access.
81.PP
82Decompression can't be parallelized, at least not without specially prepared
83deflate streams for that purpose. As a result,
84.I pigz
85uses a single thread
86(the main thread) for decompression, but will create three other threads for
87reading, writing, and check calculation, which can speed up decompression
88under some circumstances. Parallel decompression can be turned off by
89specifying one process
90(
91.B -dp 1
92or
93.B -tp 1
94).
95.PP
96Compressed files can be restored to their original form using
97.I pigz -d
98or
99.I unpigz.
100
101.SH OPTIONS
102.TP
103.B -# --fast --best
104Regulate the speed of compression using the specified digit
105.IR # ,
106where
107.B \-1
108or
109.B \-\-fast
110indicates the fastest compression method (less compression)
111and
112.B \-9
113or
114.B \-\-best
115indicates the slowest compression method (best compression).
116Level 0 is no compression.
117.TP
118.B -b --blocksize mmm
119Set compression block size to mmmK (default 128KiB).
120.TP
121.B -c --stdout --to-stdout
122Write all processed output to stdout (won't delete).
123.TP
124.B -d --decompress --uncompress
125Decompress the compressed input.
126.TP
127.B -f --force
128Force overwrite, compress .gz, links, and to terminal.
129.TP
130.B -h --help
131Display a help screen and quit.
132.TP
133.B -i --independent
134Compress blocks independently for damage recovery.
135.TP
136.B -k --keep
137Do not delete original file after processing.
138.TP
139.B -K --zip
140Compress to PKWare zip (.zip) single entry format.
141.TP
142.B -l --list
143List the contents of the compressed input.
144.TP
145.B -L --license
146Display the
147.I pigz
148license and quit.
149.TP
150.B -n --no-name
151Do not store or restore file name in/from header.
152.TP
153.B -N --name
154Store/restore file name and mod time in/from header.
155.TP
156.B -p --processes n
157Allow up to n processes (default is the number of online processors)
158.TP
159.B -q --quiet --silent
160Print no messages, even on error.
161.TP
162.B -r --recursive
163Process the contents of all subdirectories.
164.TP
165.B -S --suffix .sss
166Use suffix .sss instead of .gz (for compression).
167.TP
168.B -t --test
169Test the integrity of the compressed input.
170.TP
171.B -T --no-time
172Do not store or restore mod time in/from header.
173.TP
174.B -v --verbose
175Provide more verbose output.
176.TP
177.B -V --version
178Show the version of pigz.
179.TP
180.B -z --zlib
181Compress to zlib (.zz) instead of gzip format.
182.SH "COPYRIGHT NOTICE"
183This software is provided 'as-is', without any express or implied
184warranty. In no event will the author be held liable for any damages
185arising from the use of this software.
186.PP
187Copyright (C) 2007, 2008, 2009, 2010 Mark Adler <madler@alumni.caltech.edu>