Make a compressed tarball, and extract the same

Posted by & filed under Linux.

Create a bzip’ed tarball
tar -cjvf test.tbz home

-c tells tar to create an archive. j tells it to bzip the file. v makes it display the names of of the files as it processes them. z is to compress the file and f tells tar to use the next name in the command (test.tbz in the example). The final argument is the directory to be processed.

Likewise create a gzip’ed tarball
tar -czvf test.tar.gz home

The z flag tells it to use gzip compression.

Extracting is simple too:
tar -xzvf test.tar.gz (gzip) or tar -xjvf test.tbz (bzip)

Leave a Reply

  • (will not be published)

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>