extract tar.gz in specified folder code example
Example 1: extract from tar gz into folder
mkdir foo
tar -xzf bar.tar.gz -C foo
Example 2: extract tar.gz
tar -xf archive.tar.gz
mkdir foo
tar -xzf bar.tar.gz -C foo
tar -xf archive.tar.gz