cli-tarHow can I use tar gzip to create a multithreaded archive?
Tar gzip can be used to create a multithreaded archive by passing the -I
or --use-compress-program
option to the tar
command. This option allows you to specify an external compression program such as pigz
which is a multithreaded gzip implementation.
For example, to create a tar gzip archive using 4 threads you would run the following command:
tar -cvf archive.tar.gz -I pigz -p 4 <files-to-archive>
This command will create an archive named archive.tar.gz
using 4 threads to compress the specified <files-to-archive>
.
The parts of this command are:
tar
- The tar command which is used to create archives-cvf
- Options to create a tar archive (-c
), use a file as the archive (-f
) and create the archive in verbose mode (-v
)archive.tar.gz
- The name of the archive to be created-I pigz
- Option to specify an external compression program (in this casepigz
)-p 4
- Option to specify the number of threads to use for compression (in this case 4)<files-to-archive>
- The files to be archived
Helpful links
More of Cli Tar
- How do I use the Unix tar zip command?
- How do I use the shell to tar and zip files?
- How do I use the command line to tar and zip files?
- How do I use the command line to tar and distribute files?
- How do I create a tar.zip file in Unix?
- How do I use gzip, tar, and zip to compress files?
- How do I use the command line to tar and zip a file?
- How do I use the command line to tar and zip a file?
- How can I use tar commands to zip a file?
- How do I use the command line to tar and zip a file?
See more codes...