tar.gz to compress a directory in linux and then decompress it
a pretty common way to zip up contents in a directory into one (or technically two) archive(s).
Add to tar.gz
This will add the directory and all sub directories into the archive called the-archive-name.tar.gz from the directory the-directory you can add a full path to this if needed.
tar -zcvf the-archive-name.tar.gz the-directory
This is the code to restore the files from the archive. This one will extract it to the current directory.
tar -zxvf the-archive-name.tar.gz
You can also add a target directory to uncompress to like the following
tar -zxvf the-archive-name.tar.gz my-target-directory