Hacker News new | past | comments | ask | show | jobs | submit login

Why use tar | pigz -0 when you can just use tar?



I used tar --use-compress-program="pigz" to create the tar out of billions of files


Tar is the archiver here (putting multiple files into one file), pigz with no compression isnt doing anything besides wasting CPU time.


If you're not going to compress at all, you don't need a compressor at all. All you needed was a .tar and not a .tar.gz


But what’s confusing everyone is that tar cf - will create the tar without any external compression program needed.


I could definitely be wrong here, apologies for the confusion. I run many of these tasks automated, in some cases I used low compression, in others zero compression. For low compression, that command really shines, for zero compression, I would have bet I also got improvement over regular tar without compression, but again, I could be wrong here. I'll test it again


Even the “f -“ option is unneeded as the default is to stream to stdout. Though it’s always a bit scary to not explicitly specify the destination in case your finger slips and the first target is itself a writeable file.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: