Create archive from directory or a single file:

tar -czvf archive.name.tar.gz /target.dir 

Extracts archive:

tar xzvf archive.name.tar.gz

Extracts archive in target directory:

tar xzvf archive.name.tar.gz -C /target.dir