Tuesday, November 17, 2015

How to unzip tar.gz tgz file on Lubuntu


In this post, i will show you how to unzip tar.gz and tgz file, i should not use the word unzip because it's not the right word actually, instead i should say uncompress or extract tar.gz and tgz file, but for most people the word unzip is more popular.

On your daily life you might see some files with an extension of .tar.gz or .tgz, well the truth is tar.gz and tgz is actually the same, you can unzip/uncompress/extract tgz file the same way as tar.gz file.

To unzip/uncompress/extract tar.gz and tgz files, you can use the 'tar' command followed by some parameters, the 'tar' program/command already there on your lubuntu, so no need to install.

Let's say you have a file called myphoto.tar.gz, to unzip/uncompress/extract that file you need to do this on the terminal/console:

tar -zxvf myphoto.tar.gz

And if you want to store the output files on different path, all you have to do is add -C parameter and specified the path, like this:

tar -zxvf myphoto.tar.gz -C /home/

Same thing goes for tgz file, here's an example of extracting/uncompressing/unzipping file called android-sdk_r24.4.1-linux.tgz

tar -zxvf android-sdk_r24.4.1-linux.tgz

Like tar.gz, you can also specified the path to store the output files with -C parameter

tar -zxvf android-sdk_r24.4.1-linux.tgz -C /home/

~ cheers ~

No comments:

Post a Comment