Wednesday, May 7, 2008

Creation of Tar and Compressed file (Tar-ball) in one go

Suppose you want to create tar ball of directory xyz in your home directory.

$ cd ~

$ tar -zcvf xyz.tar.gz xyz/

or

$ tar -jcvf xyz.tar.bz2 xyz/

If you want to untar an unzip at one go, go to
the desired output directory.

$ cd ~

$ tar -zxvf xyz.tar.gz

or

$ tar -jxvf xyz.tar.bz2

No comments: