The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Special Forums > Filesystems, Disks and Memory
Google UNIX.COM


Filesystems, Disks and Memory Questions involving NAS, SAN, RAID, Robotic Libraries, backups, etc go here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to add new paths to $PATH wrapster SUN Solaris 2 06-01-2008 01:46 AM
Spoofing paths. fahadsadah UNIX for Advanced & Expert Users 3 12-26-2007 05:57 AM
create paths alias47 UNIX for Dummies Questions & Answers 4 08-07-2007 06:14 AM
Paths update phpote UNIX for Dummies Questions & Answers 5 07-25-2001 04:57 AM
paths caiohn UNIX for Dummies Questions & Answers 1 01-17-2001 04:35 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 07-21-2008
Habitual's Avatar
Registered User
 

Join Date: Jun 2008
Posts: 20
Exclamation Extracting certain /paths/* using tar

forgive my ignorance.
I did a search of this sub-forum for "tar -xp" and variations on the same w\out success, so here goes...

Scenario:
filename.tar file.

Desired Task:
I want to be able to extract only files from the user's public_html folder (and all those under it as an option) from the archive.

Usual target path:
/home/$user/public_html/*
(the archive is on a nas, so extracting to the current directory where the archive lives will have to do, for now).

What I've tried:
tar --extract --file=-filename.tar $user (I think this worked, but I was i a hurry and at the end of a long day)

What I've read to try:
tar -xp <something> (haven't had the chance to try anything along these lines)

Thank you for your time and assistance.
Reply With Quote
Forum Sponsor
  #2  
Old 07-21-2008
Smiling Dragon's Avatar
Disorganised User
 
Join Date: Nov 2007
Location: New Zealand
Posts: 734
User tar -tf <tarball> to verify the structure of the tarball first but you should be able to just name the directory to extract and it'll do that and all subdirs of it, thus:
Code:
tar xf tarball.tar /home/$user/public_html
Reply With Quote
  #3  
Old 07-22-2008
Habitual's Avatar
Registered User
 

Join Date: Jun 2008
Posts: 20
Great!
I'll have a go of it today, I'm sure.
Reply With Quote
  #4  
Old 08-01-2008
Habitual's Avatar
Registered User
 

Join Date: Jun 2008
Posts: 20
it works.

Thanks Smiling Dragon!
Reply With Quote
  #5  
Old 08-03-2008
Smiling Dragon's Avatar
Disorganised User
 
Join Date: Nov 2007
Location: New Zealand
Posts: 734
Happy to help
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 03:27 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0