Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Untar part of the tar file 2

Status
Not open for further replies.

hokky

Technical User
Nov 9, 2006
170
AU
Hi guys,

Just wondering whether thereis a way to untar some of the files of tar file ?

I check man tar, there is no such way.

Can I see the list of the file content in the tar files ?

Because my tar file is too big, so I just need some of them.

Thanks guys
 
Have a look to the Input List option of to to specify whih file you want to extract from the tar archive
 
Hi Gloups,

Can you explain more specific pls ?
 
Folowing explanation commes from AIX tar:

in the man tar:

-L InputList
The Inputlist argument to the -L option should always be the name of the file that lists the files and
directories that need to be archived or extracted.


To extract files specified in the input list file infile from an archive named ar.tar, enter:

tar xvfL ar.tar infile
 
what about if we don't know the list file,

How can we tell ? like in winzip before we extract we know what files inside it ?
 
tar -tf tarfile

gives table of contents of tarfile (the - is optional I think)

So one way:

tar -tf tarfile >/tmp/listfile

Then edit the so created listfile and use as in above posts.


HTH,

p5wizard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top