![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Unix Arithmatic operation issue , datatype issue | thambi | Shell Programming and Scripting | 23 | 02-19-2008 04:19 AM |
| Q: tar archive help | nookie | UNIX for Dummies Questions & Answers | 1 | 09-03-2007 07:30 AM |
| Archive (tar) | dreams5617 | UNIX for Dummies Questions & Answers | 4 | 03-29-2007 05:13 AM |
| Archive files | kayarsenal | Shell Programming and Scripting | 13 | 08-21-2006 08:01 AM |
| tar archive with .Z files | Kun2112 | UNIX for Dummies Questions & Answers | 3 | 08-05-2005 06:42 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
||||
|
||||
|
Tar archive issue
Hi,
I make a tar archive: tar -czvf /path_to/cucu.tar.gz /path/dir_to_archive/ In the archive the /path/dir_to_archive/ is maintained for every file. I need that the archive to be made without the /path/dir_to_archive/ to contain only the files in /path/dir_to_archive/. Thanks, Bianca |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
the answer is to cd to the directory that you are archiving and do tar up the relative locations:
tar cvf /x/file.tar ./* now when you restore you will restore your archive relative to where you are unpacking the tar ball. |
|
#3
|
||||
|
||||
|
Quote:
Bianca Last edited by potro; 06-11-2008 at 05:18 AM. |
|
#4
|
|||
|
|||
|
Quote:
looking back, I am not sure what the z flag is doing for you in the "tar czvf" - what flavor of UNIX are you using? |
|
#5
|
||||
|
||||
|
Quote:
-z, --gzip, --ungzip filter the archive through gzip RH Linux Bianca |
||||
| Google The UNIX and Linux Forums |