unzip tar gz to path code example Example 1: unzip tar.gz tar -xvf file.tar.gz Example 2: extract from tar gz into folder mkdir foo tar -xzf bar.tar.gz -C foo