Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
1  
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
2  
Not directly related, but 'z' hasn't been required since 2004/tar v1.1.5 gnu.org/software/tar/#TOCreleases :) –  JamesHannah May 18 '11 at 12:06

2 Answers 2

up vote 21 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
5  
+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

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

share|improve this answer
1  
I never use -v param. Don't know why people need that much noise in console. –  Eimantas May 18 '11 at 5:04
2  
@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

Your Answer

 
discard

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.