user788171
user788171

Reputation: 17553

how to decompress with pigz

I am trying to use pigz for parallel compress and decompress. I have found a way to compress in parallel using the following command:

tar cf - /input/dir | pigz > output_file.tar.gz

What is the equivalent command to decompress? I need to be able to specify the filename and the output directory path in the command for it to be useful for me.

Upvotes: 31

Views: 70736

Answers (4)

synkro
synkro

Reputation: 459

tar -I pigz -xvf compressed_file.tar.gz

Upvotes: 11

itsmisterbrown
itsmisterbrown

Reputation: 531

You're probably looking for something along the lines of:

pigz -dc archive.tar.gz | tar xf -

but noting Mark Adler's (legendary, at this point) original post, pigz does not utilize multiple cores for decompression. However, it does utilize additional cores for reading, writing, and some additional calculations, which do yield a moderate performance increase over gzip. Enjoy!

Upvotes: 23

For some reason, pigz doesn't autocomplete ".gz" compressed files, but if you type the names of your files pigz finds them.

To decompress and keep your compressed files use: pigz -dk yourfilename.gz. If you don't need the compressed versions use just pigz -d yourfilename.gz.

pigz --help shows all the options available.

Upvotes: 8

Mark Adler
Mark Adler

Reputation: 112384

Use pigz -dc for decompression to stdout. Then use > as you are in your example to direct the output to the desired path and file.

You can type just pigz for command options help.

Upvotes: 45

Related Questions