1PIGZ(1) General Commands Manual PIGZ(1)
2
3
4
6 pigz, unpigz - compress or expand files
7
9 pigz [ -cdfhikKlLmMnNqrRtz0..9,11 ] [ -b blocksize ] [ -p threads ] [ -S suffix
10 ] [ name ... ]
11 unpigz [ -cfhikKlLmMnNqrRtz ] [ -b blocksize ] [ -p threads ] [ -S suf‐
12 fix ] [ name ... ]
13
15 Pigz compresses using threads to make use of multiple processors and
16 cores. The input is broken up into 128 KB chunks with each compressed
17 in parallel. The individual check value for each chunk is also calcu‐
18 lated in parallel. The compressed data is written in order to the out‐
19 put, and a combined check value is calculated from the individual check
20 values.
21
22 The compressed data format generated is in the gzip, zlib, or single-
23 entry zip format using the deflate compression method. The compression
24 produces partial raw deflate streams which are concatenated by a single
25 write thread and wrapped with the appropriate header and trailer, where
26 the trailer contains the combined check value.
27
28 Each partial raw deflate stream is terminated by an empty stored block
29 (using the Z_SYNC_FLUSH option of zlib), in order to end that partial
30 bit stream at a byte boundary. That allows the partial streams to be
31 concatenated simply as sequences of bytes. This adds a very small four
32 to five byte overhead to the output for each input chunk.
33
34 The default input block size is 128K, but can be changed with the -b
35 option. The number of compress threads is set by default to the number
36 of online processors, which can be changed using the -p option. Speci‐
37 fying -p 1 avoids the use of threads entirely.
38
39 The input blocks, while compressed independently, have the last 32K of
40 the previous block loaded as a preset dictionary to preserve the com‐
41 pression effectiveness of deflating in a single thread. This can be
42 turned off using the -i or --independent option, so that the blocks can
43 be decompressed independently for partial error recovery or for random
44 access. This also inserts an extra empty block to flag independent
45 blocks by prefacing each with the nine-byte sequence (in hex): 00 00 FF
46 FF 00 00 00 FF FF.
47
48 Decompression can't be parallelized, at least not without specially
49 prepared deflate streams for that purpose. As a result, pigz uses a
50 single thread (the main thread) for decompression, but will create
51 three other threads for reading, writing, and check calculation, which
52 can speed up decompression under some circumstances. Parallel decom‐
53 pression can be turned off by specifying one process ( -dp 1 or -tp 1
54 ).
55
56 All options on the command line are processed before any names are pro‐
57 cessed. If no names are provided on the command line, or if "-" is
58 given as a name (but not after "--"), then the input is taken from
59 stdin. If the GZIP or PIGZ environment variables are set, then options
60 are taken from their values before any command line options are pro‐
61 cessed, first from GZIP, then from PIGZ.
62
63 Compressed files can be restored to their original form using pigz -d
64 or unpigz.
65
66
68 -# --fast --best
69 Regulate the speed of compression using the specified digit #,
70 where -1 or --fast indicates the fastest compression method
71 (less compression) and -9 or --best indicates the slowest com‐
72 pression method (best compression). -0 is no compression. -11
73 gives a few percent better compression at a severe cost in exe‐
74 cution time, using the zopfli algorithm by Jyrki Alakuijala.
75 The default is -6.
76
77 -A --alias xxx
78 Use xxx as the name for any --zip entry from stdin (the default
79 name is "-").
80
81 -b --blocksize mmm
82 Set compression block size to mmmK (default 128KiB).
83
84 -c --stdout --to-stdout
85 Write all processed output to stdout (won't delete).
86
87 -C --comment ccc
88 Include the provided comment in the gzip header or zip central
89 file header.
90
91 -d --decompress --uncompress
92 Decompress the compressed input.
93
94 -f --force
95 Force overwrite, compress .gz, links, and to terminal.
96
97 -h --help
98 Display a help screen and quit.
99
100 -H --huffman
101 Compress using the Huffman-only strategy.
102
103 -i --independent
104 Compress blocks independently for damage recovery.
105
106 -k --keep
107 Do not delete original file after processing.
108
109 -K --zip
110 Compress to PKWare zip (.zip) single entry format.
111
112 -l --list
113 List the contents of the compressed input.
114
115 -L --license
116 Display the pigz license and quit.
117
118 -m --no-time
119 Do not store or restore the modification time. -Nm will store or
120 restore the name, but not the modification time. Note that the
121 order of the options is important.
122
123 -M --time
124 Store or restore the modification time. -nM will store or re‐
125 store the modification time, but not the name. Note that the or‐
126 der of the options is important.
127
128 -n --no-name
129 Do not store or restore the file name or the modification time.
130 This is the default when decompressing. When the file name is
131 not restored from the header, the name of the compressed file
132 with the suffix stripped is the name of the decompressed file.
133 When the modification time is not restored from the header, the
134 modification time of the compressed file is used (not the cur‐
135 rent time).
136
137 -N --name
138 Store or restore both the file name and the modification time.
139 This is the default when compressing.
140
141 -p --processes n
142 Allow up to n processes (default is the number of online proces‐
143 sors)
144
145 -q --quiet --silent
146 Print no messages, even on error.
147
148 -r --recursive
149 Process the contents of all subdirectories.
150
151 -R --rsyncable
152 Input-determined block locations for rsync.
153
154 -S --suffix .sss
155 Use suffix .sss instead of .gz (for compression).
156
157 -t --test
158 Test the integrity of the compressed input.
159
160 -U --rle
161 Compress using the run length encoding strategy.
162
163 -v --verbose
164 Provide more verbose output.
165
166 -V --version
167 Show the version of pigz. -vV also shows the zlib version.
168
169 -z --zlib
170 Compress to zlib (.zz) instead of gzip format.
171
172 -- All arguments after "--" are treated as file names (for names
173 that start with "-")
174
175 These options are unique to the -11 compression level:
176
177 -F --first
178 Do iterations first, before block split (default is last).
179
180 -I, --iterations n
181 Number of iterations for optimization (default 15).
182
183 -J, --maxsplits n
184 Maximum number of split blocks (default 15).
185
186 -O --oneblock
187 Do not split into smaller blocks (default is block splitting).
188
190 This software is provided 'as-is', without any express or implied war‐
191 ranty. In no event will the author be held liable for any damages
192 arising from the use of this software.
193
194 Copyright (C) 2007-2022 Mark Adler <madler@alumni.caltech.edu>
195
196
197
198 January 15, 2022 PIGZ(1)