how to unzip and extract tar file in single command | Unix Linux Forums | UNIX for Advanced & Expert Users

  Go Back    


UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

how to unzip and extract tar file in single command

UNIX for Advanced & Expert Users


Tags
linux, solaris, tar, unzip

Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 12-24-2007
darkrainbow darkrainbow is offline
Registered User
 
Join Date: Jul 2007
Last Activity: 9 December 2008, 10:22 PM EST
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
how to unzip and extract tar file in single command

In order to save diskspace and avoid of disk full during
unzip then extract the tar file

is there any command would unzip and extract tar at the same time
(test123.tar.gz)

thank in advance
Sponsored Links
    #2  
Old 12-24-2007
Mr.Aketi Mr.Aketi is offline
Registered User
 
Join Date: Oct 2007
Last Activity: 26 August 2010, 4:21 AM EDT
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Hi,

I believe this will be done by using the following command.

tar -zxvf test123.tar.gz

z -- unzip
x -- extract the file
v -- verbose
f -- forcefully done

Thanks and Regards,
Aketi
Sponsored Links
    #3  
Old 12-24-2007
fahadsadah fahadsadah is offline
Registered User
 
Join Date: Dec 2007
Last Activity: 29 December 2008, 3:19 AM EST
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
I believe that -f means file.
For example:

Code:
tar -f <file>

means run the tar command on file
    #4  
Old 12-24-2007
DukeNuke2's Avatar
DukeNuke2 DukeNuke2 is offline Forum Staff  
Soulman
 
Join Date: Jul 2006
Last Activity: 31 July 2014, 10:56 AM EDT
Location: Berlin, Germany
Posts: 5,375
Thanks: 54
Thanked 229 Times in 222 Posts
Quote:
Originally Posted by darkrainbow View Post
In order to save diskspace and avoid of disk full during
unzip then extract the tar file

is there any command would unzip and extract tar at the same time
(test123.tar.gz)

thank in advance
which os do you use? linux uses gnutar which has other options then tar on solaris...
Sponsored Links
    #5  
Old 12-27-2007
zedex zedex is offline
Registered User
 
Join Date: Feb 2007
Last Activity: 3 June 2014, 8:04 AM EDT
Location: Mumbai, India
Posts: 185
Thanks: 6
Thanked 5 Times in 5 Posts
try following command


Code:
  cat test123.tar.gz | gunzip -d | tar -xvf -

if u on linux there option available to untar the zipped file
Sponsored Links
    #6  
Old 12-27-2007
prowla prowla is offline
Read Only
 
Join Date: Nov 2007
Last Activity: 16 July 2012, 4:02 PM EDT
Posts: 165
Thanks: 0
Thanked 2 Times in 2 Posts
Quote:
Originally Posted by zedex View Post
try following command


Code:
  cat test123.tar.gz | gunzip -d | tar -xvf -

if u on linux there option available to untar the zipped file
You may be able to shorten that to:


Code:
gzcat test123.tar.gz | tar -xvf -

Sponsored Links
    #7  
Old 02-28-2008
shankarjerri shankarjerri is offline
Registered User
 
Join Date: Feb 2008
Last Activity: 28 February 2008, 8:20 PM EST
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
In linux, you can user

Code:
tar -zxf <filename>.gz

Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Single command - unzip files from a tar command ericlim Shell Programming and Scripting 9 04-03-2012 02:48 PM
unzip single file in zip file to STDOUT andyatit UNIX for Dummies Questions & Answers 0 03-29-2010 01:20 PM
unzip single file and untar single file sureshg_sampat Shell Programming and Scripting 2 02-25-2010 10:23 AM
What is command to extract single file from an archieve? harshal_dcx UNIX for Advanced & Expert Users 4 12-08-2009 02:09 AM
tar command help -- extract single file icefish UNIX for Dummies Questions & Answers 7 07-01-2008 02:02 PM



All times are GMT -4. The time now is 11:33 AM.