The following are commands that must be given from a console session. If you are working on a remote server you will need SSH access to use these commands. On some systems you will need to precede the commands with sudo to gain administrator access. You will need to provide your password when prompted after giving sudo [commands…] from the console.
tar cvzf test.tar.gz /www/test/
Makes a tar.gz compressed archive named test.tar.gz from the test directory, including all sub directories under test.
tar xvzf test.tar.gz
Extracts the files in the test.tar.gz archive
tar -xvzf file.tar.gz -C directory
Extracts to the indicated directory.
tar -xvjf file.tar.bz2 -C directory
Extracts a tar.bz2 compressed file.