konosubakonoakua / blog

https://konosubakonoakua.github.io/blog/
MIT License
0 stars 0 forks source link

[sw][linux][command] tar multithread #90

Open konosubakonoakua opened 2 months ago

konosubakonoakua commented 2 months ago

tar.xz

tar -cvf - my_folder/ | xz -T 0 -c > my_folder.tar.xz

-T 后面跟上的参数是要使用的线程数量,0 代表尽可能多的使用 CPU 线程。

konosubakonoakua commented 2 months ago

pigz

compress

tar --use-compress-program="pigz -k -p8" -cf output.tgz *

decompress (a little bit faster)

tar --use-compress-program="pigz -k -p8" -xf output.tgz
konosubakonoakua commented 2 months ago

references