Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there anyway to extract a tar.gz file faster than tar -zxvf filenamehere?

We have large files, and trying to optimize the operation.

share|improve this question
Are you finding that the $ tar -zxvf method is IO or CPU bound? – EEAA May 18 '11 at 4:07
Believe CPU, how can I check though? – Justin May 18 '11 at 4:11
Not directly related, but 'z' hasn't been required since 2004/tar v1.1.5 :) – JamesHannah May 18 '11 at 12:06
up vote 33 down vote accepted

pigz is a parallel version of gzip. Although it only uses a single thread for decompression, it starts 3 additional threads for reading, writing, and check calculation. Your results may vary but we have seen significant improvement in decompression of some of our data sets. Once you install pigz the tar file can be extracted with:

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

share|improve this answer
+1. FWIW, you can also write that as tar -xvf --use-compress-program=pigz filenamehere. (-z amounts to --use-compress-program=gzip.) Alternatively, you can even make gzip be a symlink to pigz, and keep using -zxvf. – ruakh Nov 19 '12 at 22:36
@ruakh, I had to put -xf after --use-compress-program=pigz, or I got an error. For some reason, it was no faster than using gzip though. – jonderry Mar 7 '15 at 22:39
For bzip2 there is pbzip2 (p for parallel). tar --use-compress-program=pbzip2 -xvf file.tar.bz2. – alfC Sep 22 '15 at 17:56

if there are many many many small files in the tar ball, cancel the ‘v’ parameter, try again!

share|improve this answer
I never use -v param. Don't know why people need that much noise in console. – Eimantas May 18 '11 at 5:04
@Eimantas When you untar something that contains many multi-gigabyte files, you will want some indication of progress. :) – Michael Hampton May 18 '13 at 16:08
If you want to see progress use something like pv. eg. pigz -dc mysql-binary-backup.tar.gz | pv | tar -xf - – Tim Hughes Dec 1 '15 at 10:46

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.