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 04: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 03:35 PM

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

Join Date: Jun 2008
Posts: 17
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 (permalink)  
Old 07-21-2008
Smiling Dragon's Avatar
Disorganised User
 
Join Date: Nov 2007
Location: New Zealand
Posts: 711
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 (permalink)  
Old 07-22-2008
Habitual's Avatar
Registered User
 

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

Join Date: Jun 2008
Posts: 17
it works.

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

Thread Tools
Display Modes




All times are GMT -7. The time now is 08:20 AM.


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 Global Fact Book

Content Relevant URLs by vBSEO 3.2.0