Empowering you to understand your world

How To Use All Cores When Compressing Or Extracting Archives

You can compress or extract archives much faster than usual if you utilize all of your CPU cores simultaneously. The first step is to install ‘bzip2’, which you’ll be using with ‘tar’.

sudo apt install pbzip2

Compressing Files Using All CPU Cores

You can compress or ‘zip’ files in a fraction of the usual time by using the following command to utilize ‘tar’ and ‘bzip2’:

The following example is for the ‘bz2’ archive format.

tar -I pbzip2 -cf archivename.bz2 foldertocompress/

You can add ‘time’ before that command if you want it to tell you how long the compression process took.

Extracting Files Using All CPU Cores

You can extract or ‘unzip’ archives rapidly using all cores, thanks to the following command:

The following command will extract the files into the directory that the command was run under.

tar -I pbzip2 -xf archivename.bz2
Subscribe to our newsletter
Get notified when new content is published