Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Opening a .tar.gz file with a single command [closed]

When I download a .tar.gz file, I open it with two commands, first gunzip and then tar.

Is it possible to open it with just one command?

like image 595
flybywire Avatar asked Mar 16 '09 15:03

flybywire


People also ask

How do I open a tar gz file in CMD?

To extract a tar. gz file, use the tar -xf command followed by the archive name.

How do I open a .gz file in Unix without unzipping?

Just use zcat to see content without extraction. From the manual: zcat is identical to gunzip -c . (On some systems, zcat may be installed as gzcat to preserve the original link to compress .)

How do I unpack a tar gz file?

Simply right-click the item you want to compress, mouseover compress, and choose tar. gz. You can also right-click a tar. gz file, mouseover extract, and select an option to unpack the archive.

How do I open a tar gz file without unzipping it in Linux?

Use -t switch with tar command to list content of a archive. tar file without actually extracting. You can see that output is pretty similar to the result of ls -l command.


2 Answers

tar xzf file.tar.gz 

The letters are:

  • x - extract
  • z - gunzip the input
  • f - Read from a file, not stdin
like image 98
unwind Avatar answered Sep 20 '22 22:09

unwind


You can use tar with a "z" argument

tar xvfz mytar.tar.gz 
like image 33
WiseTechi Avatar answered Sep 23 '22 22:09

WiseTechi