Friday, March 22, 2013

How do I uncompress a tarball?

To uncompress a tarball, execute the following command(s) depending on the extension:
tar zxf file.tar.gz
tar zxf file.tgz
tar jxf file.tar.bz2
tar jxf file.tbz2
The following doc snippets explain the tar options being used:
#Extract: tar -xf <archive-filename>
#-z, -j, -J, --lzma  Compress archive with gzip/bzip2/xz/lzma
Lastly, if you were to run "tar zxf file.tar.gz" you would end up with a new directory named "file" in your current directory.

No comments:

Post a Comment

About Me

My photo
I code. I figured I should start a blog that keeps track of the many questions and answers that are asked and answered along the way. The name of my blog is "One Q, One A". The name describes the format. When searching for an answer to a problem, I typically have to visit more than one site to get enough information to solve the issue at hand. I always end up on stackoverflow.com, quora.com, random blogs, etc before the answer is obtained. In my blog, each post will consist of one question and one answer. All the noise encountered along the way will be omitted.