1PIGZ(1)                     General Commands Manual                    PIGZ(1)
2
3
4

NAME

6       pigz, unpigz - compress or expand files
7

SYNOPSIS

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

DESCRIPTION

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.
60
61       Compressed  files  can be restored to their original form using pigz -d
62       or unpigz.
63
64

OPTIONS

66       -# --fast --best
67              Regulate the speed of compression using the specified  digit  #,
68              where  -1  or  --fast  indicates  the fastest compression method
69              (less compression) and -9 or --best indicates the  slowest  com‐
70              pression  method (best compression).  -0 is no compression.  -11
71              gives a few percent better compression at a severe cost in  exe‐
72              cution  time,  using  the  zopfli algorithm by Jyrki Alakuijala.
73              The default is -6.
74
75       -A --alias xxx
76              Use xxx as the name for any --zip entry from stdin (the  default
77              name is "-").
78
79       -b --blocksize mmm
80              Set compression block size to mmmK (default 128KiB).
81
82       -c --stdout --to-stdout
83              Write all processed output to stdout (won't delete).
84
85       -d --decompress --uncompress
86              Decompress the compressed input.
87
88       -f --force
89              Force overwrite, compress .gz, links, and to terminal.
90
91       -h --help
92              Display a help screen and quit.
93
94       -i --independent
95              Compress blocks independently for damage recovery.
96
97       -k --keep
98              Do not delete original file after processing.
99
100       -K --zip
101              Compress to PKWare zip (.zip) single entry format.
102
103       -l --list
104              List the contents of the compressed input.
105
106       -L --license
107              Display the pigz license and quit.
108
109       -m --no-time
110              Do not store or restore the modification time. -Nm will store or
111              restore the name, but not the modification time. Note  that  the
112              order of the options is important.
113
114       -M --time
115              Store  or  restore  the modification time. -nM will store or re‐
116              store the modification time, but not the name. Note that the or‐
117              der of the options is important.
118
119       -n --no-name
120              Do  not store or restore the file name or the modification time.
121              This is the default when decompressing. When the  file  name  is
122              not  restored  from  the header, the name of the compressed file
123              with the suffix stripped is the name of the  decompressed  file.
124              When  the modification time is not restored from the header, the
125              modification time of the compressed file is used (not  the  cur‐
126              rent time).
127
128       -N --name
129              Store  or  restore both the file name and the modification time.
130              This is the default when compressing.
131
132       -C --comment ccc
133              Include the provided comment in the gzip header or  zip  central
134              file header.
135
136       -p --processes n
137              Allow up to n processes (default is the number of online proces‐
138              sors)
139
140       -q --quiet --silent
141              Print no messages, even on error.
142
143       -r --recursive
144              Process the contents of all subdirectories.
145
146       -R --rsyncable
147              Input-determined block locations for rsync.
148
149       -S --suffix .sss
150              Use suffix .sss instead of .gz (for compression).
151
152       -t --test
153              Test the integrity of the compressed input.
154
155       -v --verbose
156              Provide more verbose output.
157
158       -V --version
159              Show the version of pigz. -vV also shows the zlib version.
160
161       -z --zlib
162              Compress to zlib (.zz) instead of gzip format.
163
164       --     All arguments after "--" are treated as file  names  (for  names
165              that start with "-")
166
167       These options are unique to the -11 compression level:
168
169       -F --first
170              Do iterations first, before block split (default is last).
171
172       -I, --iterations n
173              Number of iterations for optimization (default 15).
174
175       -J, --maxsplits n
176              Maximum number of split blocks (default 15).
177
178       -O --oneblock
179              Do not split into smaller blocks (default is block splitting).
180
182       This  software is provided 'as-is', without any express or implied war‐
183       ranty.  In no event will the author be  held  liable  for  any  damages
184       arising from the use of this software.
185
186       Copyright (C) 2007-2021 Mark Adler <madler@alumni.caltech.edu>
187
188
189
190                               January 23, 2021                        PIGZ(1)
Impressum