![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| how to extract files one by one from a directory and let some processing happen | saniya | Shell Programming and Scripting | 7 | 05-23-2008 03:58 AM |
| extract tar files without creating directory | here2learn | UNIX for Dummies Questions & Answers | 4 | 10-02-2006 04:42 PM |
| How to extract archive to a specified directory | john_trinh | UNIX for Dummies Questions & Answers | 4 | 03-02-2004 03:07 PM |
| extract a sub directory form a tar file | Optimus_P | UNIX for Advanced & Expert Users | 2 | 01-28-2004 10:23 AM |
| redirecting tar extract to another directory | colesy | UNIX for Dummies Questions & Answers | 7 | 01-28-2003 01:40 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
tar extract to different directory
Hi,
I created a tar file of a directory dir1 from /tmp in the following way $pwd /tmp $tar -cvf dir1.tar dir1 (dir1 will have say file1) Now i want to extract it in the directory /tmp/dir2 so that the directory dir1 is also created and extracted (/tmp/dir2/dir1/file1). Is there any way without creating the directory first(dir1) the dir1 can be extracted? Thanks in advance Ammu |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
Code:
(cd /tmp; tar cf - dir1) | (cd /tmp/dir2; tar xf - ) |
||||
| Google The UNIX and Linux Forums |