To extract a tar.gz file, the most basic syntax is as the following;

$ tar xvf filename.tar.gz

The command will extract the file to the current working directory. Current versions of the tar program doesn’t require the -z switch, as it auto detects the file format and extract accordingly.

To extract in verbose mode, and to a directory called /target, the following is the syntax;

$ tar xvf filename.tar.gz -C /target