To create a .gz archive of a directory and its sub-directories
tar -cvzf filename.tar.gz directory_to_compress/
To extract the compressed file, replace -cvzf with -xvzf
To create a .zip acrhive
zip -r filename.zip folder_to_zip
About Bhupendra Kunwar