How do I: UNIX command line uncompress tar.gz

  • redgtsviper
  • Novice
  • Novice
  • No Avatar
  • Joined: Feb 25, 2006
  • Posts: 18
  • Status: Offline

Post October 5th, 2006, 2:20 pm

HELP!

I have a file called file.tar.gz. How can I uncompress this file on a redhat server from command line. I want all the files extracted the the current directory that I am in
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post October 5th, 2006, 2:20 pm

  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Joined: Dec 20, 2002
  • Posts: 8922
  • Loc: Seattle, WA & Phoenix, AZ
  • Status: Offline

Post October 5th, 2006, 3:19 pm

There is more than one way to do this, however I tend to do it like this from command prompt:

gunzip file.tar.gz
tar -xvf file.tar

Alternatively you can use one single command to do all the work:

tar -zxvf file.tar.gz

The -z basically does the gunzip work for you. Hope that helps.
Ozzu Hosting - Want your website on a fast server like Ozzu?
  • AnarchY SI
  • Web Master
  • Web Master
  • User avatar
  • Joined: Oct 30, 2004
  • Posts: 2521
  • Loc: /usr/src/MI
  • Status: Offline

Post October 7th, 2006, 1:36 pm

tar -zxvf = <3
Image
"In a world without walls and fences, who needs Windows and Gates?"
  • kikwete
  • Novice
  • Novice
  • No Avatar
  • Joined: Mar 26, 2008
  • Posts: 17
  • Status: Offline

Post January 18th, 2009, 11:52 pm

tar is a compression technology used to create a Tape ARchive. The resulting file is known as a tarball.

If you have 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 in linux.

[
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
  • AnarchY SI
  • Web Master
  • Web Master
  • User avatar
  • Joined: Oct 30, 2004
  • Posts: 2521
  • Loc: /usr/src/MI
  • Status: Offline

Post January 20th, 2009, 8:06 am

/cheer for 3 years later..?
Image
"In a world without walls and fences, who needs Windows and Gates?"
  • kc0tma
  • o|||||||o
  • Web Master
  • User avatar
  • Joined: Jul 20, 2007
  • Posts: 3318
  • Loc: Trout Creek, MT
  • Status: Offline

Post January 23rd, 2009, 10:25 am

kikwete wrote:
If you have Window, this is the same as a Zip file. You use winzip to compress and uncompress .zip files.So its the same idea.


And winblows zipped files are different from tarballs. A zipped file is compressed, whereas a tarball is just a bunch of files clumped together into one unit not at all compressed.
Like Mr Spork, I also write about my interest in alcoholic beverages.

Post Information

  • Total Posts in this topic: 6 posts
  • Users browsing this forum: No registered users and 48 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.