HOWTO: Open a TAR File.
There are several different combinations of tar balls out there and each of them has their own way to ‘unzip’ them (to steal a Windows-ism). Developers and vendors make their files available in any way they please, but typically they make a TAR file and then compress it.
First, TAR is a program that stands for ‘Tape ARchive’. It takes a bunch of files and puts them into one file, affectionately called a tarball. The tarball is just the collection of files, it is not compressed. Tarball file names usually take the following form:
file.tar
Usually the tarball is then compressed using either GZip or BZip2. It is common courtesy for the resulting file to be named in such a way that the end user can tell how it has been compressed so they know how to uncompress it. Common file name conventions are:
- file.tar.gz: This file is a tarball that has been compressed with GZip
- file.tgz: Same as above
- file.tar.bz2: This file is a tarball that has been compressed with BZip2
- file.tbz: Same as above
To get at the actual file you will need to uncompress it to get the tarball and then untar the tarball. This could be done in two steps as in:
- For bzip2 files: bunzip2 file.tar.bz2 or bunzip2 file.tbz
- tar -xvf the resultant tarball
- For GZip file: gunzip file.tar.gz or gunzip file.tgz
- tar -xvf the resultant tarball
Or you can do it in one step by using:
- tar -zxvf file.tar.gz or file.tgz
- tar -xvf file.tar.bz or file.tbz
There are many GUI tools available to deal with archived files such as Ark in KDE, so you may never have to go down to the command line to do this. But if you do - these commands should help!
Related Stories
POSTED IN: How To
3 opinions for HOWTO: Open a TAR File.
New Linux User » HOWTO: Best Of - Installing Applications in GNU/Linux
Jan 25, 2006 at 8:02 am
[…] First you have to unzip the tarball to get at the internal files. Here’s a link to an article I wrote on how to ‘untar’ various types of files. […]
Mahesh Sawant
Nov 2, 2007 at 11:19 pm
Thank you
andreea
Aug 4, 2008 at 8:22 pm
Thanks very helpful!
Have an opinion? Leave a comment: