To compress a file or folder do this command:

in this example, i want to tar my web directory:

Code/Command:
tar -pczf web.tar.gz web/



Now to untar:

Code/Command:
tar xvfz web.tar.gz