How To Untar .Tar Files

January 29, 2009 by · 4 Comments 

First, some words about .tar files. TAR is a really old file format. It harkens back to the bad old times when hard disks were rare and tapes ruled the field of backup and storage. In fact, “TAR” is an acronym for tape archive. On the other hand, despite it’s suggestive name, it probably woun’t be considered a “real” archive by most contemporary users, as it offers no data compression. A .tar file is, in essence, just a number of different files strung together.

Since a TAR file offers no compression features by itself, the files are typically compresed with an additional archiver. Common examples include Gzip (extension .tar.gz) and the Bzip compressor, which produces .tar.bz2 files in turn. So sometimes you might need more than one program to extract a .tar file – e.g., a rar converter might prove of use.

Lets get down to the important question. To extract a “plain” TAR archive on a Unix-based OS, use this command line : “tar -xvf filename.tar”. This will unzip the contents of the file in the current directory. In case the archive has been compressed with gzip (.tar.gz), you need to add the “z” flag to the aforementioned command; like this : “tar -xzvf filename.tar.gz”.

If you’re using Windows, fear not – most semi-decent archivers can deal with .tar files. For example, WinRAR (commercial) and 7-zip (open source) can both open .tar, .tar.gz, and many other archive formats easily. With WinRAR unzipping a TAR file is as easy as right-click followed by “Extract here” from the context menu.

The techniques explained in this article should be enough to deal with most .tar archives you’ll ever come across. If you encounter something that wasn’t addressed here, there’s always Google, ready to answer every query.