We often receive questions from you guys about the .tgz file format and how you can open it. Since we have been getting a lot more of those than we anticipated to, we have decided to present you with this little instruction that will explain you how to open your .tgz file in the clearest way possible. Shall we go ahead with that?
Firstly, let’s clear things up a bit – what is exactly a file ending with a .tgz? The answer is easy – it’s nothing more than an archive! Basically, it acts like a ‘container’ for many other files, folders and subfolders. If you don’t already know, in most cases it is compressed by a certain program and can be opened with that very program in the future. But that is not what we are focusing on today.
A .tgr or a .tar.gzor file is a tape archive file that is common for the Linux world. There are several ways to unpack these files, depending on the one you have.
If you are using something like MinGW/MSYS or Cygwin, then you should use the following command to open such files:
tar xvf <.tar file>
tar xzvf <.tar.gz file>
tar xjvf <.tar.bz2 file>
You can also download and install a program that will do all the stuff for you. Find the one that catches your eye so that you are never irritated by the way it looks or something. There lots of programs that can be found online, so go ahead and dive into that world of choice! If you pick the right one, you can also use it in the future to unpack some of the more difficult formats.
So, if you were to download some kind of an app, here’s what you would need to do:
- Go online and find the program you want to install. Once you make up your mind, press that download button and wait for it to appear in your ‘downloads’ folder (or the one you decided to save it into). Once downloaded, install your program according to its instructions.
- You have to add the very directory you decided to install into your path. (Press ‘Start’ -> ‘Control Panel’ -> ‘System’ -> ‘Advanced’ -> ‘Environment Variables’).
- Once you are finished with that, relocate your .tgz file to your directory of choice.
- If your file appears to be compressed, you should type 7z (for certain programs) x tar.gzat your command prompt. Here, ‘filename.tar.gz’ stands for the name of the compressed file). After you do all that, your file should be transformed to a tar file called filename.tar
You can also use the file manager to open a .tgz file. You can do so by clicking on a .tar, .tar.gz, or.tar.bz2 file and the program you have chosen will start automatically.
For all the Windows users, there exists a simple command line tool. You won’t need to install anything, you will only have to unzip the archive file.
Go to the codeplex tartool, which should be complete with the source code. It can do two things: decompress and untar files of the .tar.gz (.tgz) format and simply untar .tar and .tgz files.
There are the commands for that:
>TarTool sourceFile destinationDirectory
>TarTool D:\sample.tar.gz ./
>TarTool sample.tgz temp
>TarTool -x sample.tar temp
And that is basically it! We really hope you enjoyed this little tutorial and that things are now looking a bit clearer for you. Take care!