How do I: UNIX command line uncompress tar.gz

  • redgtsviper
  • Novice
  • Novice
  • redgtsviper
  • Posts: 19

Post 3+ Months Ago

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
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Posts: 9089
  • Loc: Seattle, WA & Phoenix, AZ

Post 3+ Months Ago

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.
  • AnarchY SI
  • Web Master
  • Web Master
  • User avatar
  • Posts: 2521
  • Loc: /usr/src/MI

Post 3+ Months Ago

tar -zxvf = <3
  • kikwete
  • Novice
  • Novice
  • kikwete
  • Posts: 17

Post 3+ Months Ago

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
  • Posts: 2521
  • Loc: /usr/src/MI

Post 3+ Months Ago

/cheer for 3 years later..?
  • kc0tma
  • o|||||||o
  • Web Master
  • User avatar
  • Posts: 3318
  • Loc: Trout Creek, MT

Post 3+ Months Ago

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.

Post Information

  • Total Posts in this topic: 6 posts
  • Users browsing this forum: No registered users and 19 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
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.