Unix/Linux 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, tar unzip, unzip

Closed Linux or Unix Question    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 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 tar unzip command would unzip and extract tar at the same time
(test123.tar.gz)

thank in advance
Sponsored Links
    #2  
Old Unix and Linux 12-24-2007
Mr.Aketi Mr.Aketi is offline
Registered User
 
Join Date: Oct 2007
Last Activity: 16 May 2015, 10:02 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 Unix and Linux 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 Unix and Linux 12-24-2007
DukeNuke2's Unix or Linux Image
DukeNuke2 DukeNuke2 is offline Forum Staff  
Soulman
 
Join Date: Jul 2006
Last Activity: 31 August 2015, 11:48 AM EDT
Location: Berlin, Germany
Posts: 5,510
Thanks: 61
Thanked 251 Times in 244 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 Unix and Linux 12-27-2007
zedex zedex is offline
Registered User
 
Join Date: Feb 2007
Last Activity: 1 March 2015, 1:12 PM EST
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 Unix and Linux 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 -

Linux
Sponsored Links
    #7  
Old Unix and Linux 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 Linux or Unix Question

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux 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 03:48 PM.