(Un)Compress a file(tar/tar.gz)

No replies
bOtskOOl
User offline. Last seen 19 weeks 2 days ago. Offline
Joined: 02/21/2009
bOt Points: 3496

Tar is only a archive it is not a compression format so make a tar.gz if you wish to compress a file

Create an archive

$ tar -cvf foo.tar foo

Extract files from archive

$ tar -xvf foo.tar

Create archive and compress

$ tar -cvzf foo.tar.gz

Extract files form tar.gz

$ tar -xvf foo.tar.gz

You can also use : $ tar -xvzf foo.tar.gz

{-c create a new archive

-v: verbose

 -f:use this file

-x:extract

-z: to gzip tar file
}