How To Untar a Tarball .tar or .tar.gz File In Linux Shell Command

this is a very good tutorial that shows you how to uncompress a tarbal file using the linux command.

Today I will show you how to uncompress a tarball. Tarballs are files with a .tar extension. The most common extension in linux that I see is the .tar.gz. But if you dont have a Linux Box, then you most likely have a Windows PC. If so, you can use Winzip to uncompress the tar ball and maybe you can give Linux a try - Its great! and Best of all, Its FREE!. Else, If you are not familiar with the Linux Shell Command, and you have a linux computer or server continue on reading this how to guide tutorial...

These commands are useful on linux, if you are an admin, you will defenetly need these. so take notes.

or you can bookmark this page better!

so here we go:

tar is a compression technology used to create a Tape ARchive. The resulting file is known as a tarball. If you are fimiliar with Window, this is the same as a Zip file. You use winzip to compress and uncompress .zip files.So its the same idea. To uncompress the files (or to get the files out of a tarball), you can use the following commands:

tar xvf filename.tar

 

If the tarball has also been gzipped (compressed), you can use the following command:
tar xvfz filename.tar.gz

 

If you only want certain directories from the tarball, do this:
tar xvzf filename.tar.gz */dir.you.want/*

 

If you have a .tar.bz2 file, then you need bzip2 installed (/usr/ports/archivers/bzip2), and you issue this command:
tar yxf filename.tar.bz2

Hope this helps

 

8788 - Sat Feb 02, 2013 22:11:24