If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > How to extract a single file from a tar file

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-12-10, 23:08
MIKELALA MIKELALA is offline
Registered User
 
Join Date: Nov 2009
Posts: 44
How to extract a single file from a tar file

Hello Dear,

I have a tar file that contains huge number of files with huge file sizes. I don't want to extract all the files becoz of disk space issue . I want to retrieve a single file from it .

can any one tell me how to get that particular file say the file name is abc_pqr_xyz.une

I want a single command that gets the file required .

note:- assume that file extracted to be placed in the same directory of tar.


Appreciate your quick reply



thanks/mike
Reply With Quote
  #2 (permalink)  
Old 01-13-10, 04:00
pdreyer pdreyer is offline
Registered User
 
Join Date: May 2005
Location: South Africa
Posts: 1,258
just specify the path and filename as it is in the tar file
If not shure about path name
tar tvf thetarfile | grep abc_pqr_xyz.une
Reply With Quote
  #3 (permalink)  
Old 01-17-10, 00:07
MIKELALA MIKELALA is offline
Registered User
 
Join Date: Nov 2009
Posts: 44
This is also one of the ways to extract a particular file from tar


$tar -xvf <TarFileName> <FileNameToBeExtracted>
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On