linux unzip tar.gz code example

Example 1: how to untar tar.gz

tar xvzf file.tar.gz

Example 2: extract tar.gz ubuntu terminal

tar -xvf yourfile.tar.gz

Example 3: untar tar.gz

tar -xzf file.tar.gz

Example 4: extract tar.gz

tar -xf archive.tar.gz

Example 5: unarchive tar acrhive

tar -xvf file.tar etc/resolv.conf
tar -xzvf file.tar.gz etc/resolv.conf
tar -xjvf file.tar.bz2 etc/resolv.conf

#Extract files into a specific folder
tar -xf archive.tar.gz -C /home/linuxize/files