Tuesday, July 03, 2007

tar command for bz2 files.

Use

In Unix, bzip2 can be used combined with or independently of tar: bzip2 file to compress and bzip2 -d file.bz2 to uncompress (the alias bunzip2 for decompression may also be used).

bzip2's command line flags are mostly the same as in gzip. So, to extract from a bzip2-compressed tar-file:

bzip2 -d <archivefile.tar.bz2 | tar -xvf -     or
bunzip2 <archivefile.tar.bz2 | tar -xvf -

To create a bzip2-compressed tar-file:

tar -cvf - filenames | bzip2 >archivefile.tar.bz2

GNU tar supports a -j flag, which allows creation of tar.bz2 files without a pipeline:

tar -cvjf archivefile.tar.bz2 file-list 

Decompressing in GNU tar:

tar -xvjf archivefile.tar.bz2

1 comment:

Anonymous said...

okmpj communities intent highly noticeboards globally devices kartikamba attack industrythe generation
lolikneri havaqatsu