Compress folder to folder.tar.gz:
tar -pcvzf file.tar.gz folder
Uncompress:
Just switch the ‘c’ flag to an ‘x’ to extract
tar -pxvzf file.tar.gz -C destination_folder
Cheatsheet:
p == preserve permissions
c == create archive
v == verbose (print names while making tar)
z == gzip
f == tar file name
As read on: www.futurequest.net