Who says pigz can't fly?
find . -mindepth 1 -maxdepth 1 -type d -print0 | xargs -0 -I{} sh -c 'dir=$(basename "{}"); tar -cf - "$dir" | pigz -p 10 > "${dir}.tar.gz"
This nifty command quickly generates compressed tar archives (.tar.gz) of all subdirectories in the current directory (excluding the current directory itself) using tar and pigz. By using pigz instead of tar -c, you can specify the number of parallel threads to use for compression, resulting in much faster .gz archive creation. Watch those directories soar like a herd of flying pigs with pigz!
Written by Lars Van Casteren
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Shell pigz tar parallel speed
Authors
Related Tags
#shell pigz tar parallel speed
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#