Here are two important tar commands on how to create and extract a tar.gz file.

Create a tar gzip file called “project.tar.gz” of a directory called “foo.”

<pre lang="bash">
tar -cvzf project.tar.gz foo

Untar the “project.tar.gz” file to a directory called bar.

<pre lang="bash">
tar -xvzf project.tar.gz bar