compress and decompress a tar gz file code example Example 1: extract tar gz tar -xvf archive.tar.gz Example 2: extract tar.gz tar -xf archive.tar.gz