linux extract gz file code example

Example 1: how to extract tgz file in linux

tar zxvf file_name.tgz

where,
-z : Uncompress the resulting archive with gzip command
-x : Extract to disk from the archive
-v : Produce verbose output i.e. show progress and file names while extracting files
-f backup.tgz : Read the archive from the specified file called backup.tgz

Example 2: unzip a .gz file in linux

gunzip file.gz

Example 3: extract gz file ubuntu

gzip -d file.gz

Example 4: unzip gz file linux

Unzip a . GZ file by typing "gunzip" into the "Terminal" window