To create the archive files use following command
tar -czf test.tar.gz test/
To extract the files use following command
tar -xzf test.tar.gz
tar -czf test.tar.gz test/
To extract the files use following command
tar -xzf test.tar.gz