To unpack a tar archive ending in .tar.gz use the following command:
tar -xzf archive.tar.gz
To unpack a tar archive ending in .tar.gz use the following command:
tar -xzf archive.tar.gz
Go inside the director you want to create an archive of and write:
# tar -czf archive.tar.gz *
The * means all the files. You can use other filters if you wish.