[{TableOfContents }]

!!!Tar

!!Archive/Compress

Creates a GZIP-compressed Tar file of the name eglinux.tar.gz of all files with a .txt suffix.

%%prettify 
{{{
$ tar -czf eglinux.tar.gz *.txt
}}}
/%

Make a compressed archive of a folder (recursively):

%%prettify 
{{{
$ tar -czf target.tar.gz folder/*
}}}
/%

{{{
$ tar -cjf file.tar.bz2 dir
}}}

!! Tar/Gz Using Pipes

To compress current directory

%%prettify 
{{{
tar cvf - . | gzip > target.tar.gz
}}}
/%


To compress only text files

%%prettify 
{{{
tar cvf - *.txt | gzip > target.tar.gz
}}}
/%

!! XZ

XZ (used exactly like gzip) is on the order of 30% better than gzip and 15% better than bzip2.

!! Parallel Optimization

Pigz is a parallel implementation of gzip

%%prettify 
{{{
tar cvf - . | pigz > target.tar.gz
}}}
/%

Pbzip2 is a parallel implementation of bzip2

%%prettify 
{{{
tar cvf - . | pbzip2 > target.tar.bz2
}}}
/%

[Pixz | https://github.com/vasi/pixz] is a parallel implementation of xz

%%prettify
{{{
pixz -9t -p8 filename filename.pxz
}}}
/%

!!View

List files in a compressed Tar file

%%prettify 
{{{
$ tar -tzf eglinux.tar.gz
}}}
/%

!!Extract

Extracts all files from a compressed Tar file of the name eglinux.tar.gz.

%%prettify 
{{{
$ tar -xf eglinux.tar.gz
}}}
/%

or 
%%prettify 
{{{
tar -zxvf Python-2.5.2.tgz
}}}
/%

To extract to a specific folder

%%prettify 
{{{
$ tar -xf eglinux.tar.gz -C ~/des
}}}
/%

To extract a bz2, tar.bz2, bzip2 file:
{{{
bzcat Python-2.5.2.tar.bz2 | tar -xf -
}}}

or

{{{
tar xvfj Python-2.5.2.tar.bz2
}}}

*NOTE*: use {{-k}} to keep the compressed file and not delete it.
----
[Category.Archived] - [CategoryArchived.Computing] - [Performance | CategoryArchived.Computing.Performance]