jucas_lo
March 6th, 2009, 12:15 PM
Hi! I need to do make a bash script, and i have to create a tar file of a directory. Now I have two small problems that if I manage to resolve, would make my life a lot easier:
1) I need to tar the directory test/conf. So i do:
tar -uf conf.tar test/conf/
In the tar created i get a directory test and under this I get the folder conf (test/conf). So is there a way to tell tar to create only a conf folder in the tarfile (i.e. instead of test/conf just conf) without manually changing dirs?. I tried:
tar -uf conf.tar testrel/conf/ -C testrel/conf/ but it didn't work
2) Can I change the name of the output folder when extracting ? for instance if I am extracting a tar in which there is only one folder called conf, can i tell tar to extract it with the name conf2???
I would really appreciate any suggestion!!!
thanks guys!
:popcorn:
1) I need to tar the directory test/conf. So i do:
tar -uf conf.tar test/conf/
In the tar created i get a directory test and under this I get the folder conf (test/conf). So is there a way to tell tar to create only a conf folder in the tarfile (i.e. instead of test/conf just conf) without manually changing dirs?. I tried:
tar -uf conf.tar testrel/conf/ -C testrel/conf/ but it didn't work
2) Can I change the name of the output folder when extracting ? for instance if I am extracting a tar in which there is only one folder called conf, can i tell tar to extract it with the name conf2???
I would really appreciate any suggestion!!!
thanks guys!
:popcorn: