André Figueira

Systems engineer - I write apps, I make websites, opinions are my own...

How to tar and untar files in unix

A quick one to compress and uncompress files with tar

The following are the 5 most commonly used options for tar – c, z, f, v, x

v = verbose , display file to compress or uncompress
c = create a new tar file
f = create the tar file with filename provided as the argument
x = extract file
z = use gzip to zip it

Compress the file

tar -cvzf file.tar.gz file

Uncompress the file

tar -xvzf file.tar.gz