![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Filesystems, Disks and Memory Questions involving NAS, SAN, RAID, Robotic Libraries, backups, etc go here. |
|
|
||||
| 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 |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
||||
|
||||
|
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. |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
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 |
|
#3
|
||||
|
||||
|
Great!
I'll have a go of it today, I'm sure. |
|
#4
|
||||
|
||||
|
it works.
Thanks Smiling Dragon! |
|
#5
|
||||
|
||||
|
Happy to help
|
||||
| Google The UNIX and Linux Forums |