LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   tar follow symlink on extract (https://www.linuxquestions.org/questions/linux-newbie-8/tar-follow-symlink-on-extract-4175424708/)

McZ 08-30-2012 02:55 AM

tar follow symlink on extract
 
is it possible to make tar follow symlinked directories when extracting a package?

file.tar contains:
/lib/libfile1.so
/lib/libfile2.so

and on my system /lib is a symlink to /lib64 if I extract file.tar to / ( tar x file.tar -C / ) it overwrites the /lib symlink. Can I go around this?

zQUEz 08-30-2012 05:06 AM

I just tested your example and it achieves what you want out of the box.
I can't imagine tar changes much, but, I am using "tar-1.15.1-32.el5_8".
I tarred everything in /etc
In a test folder, I created a etc symlink to a different test directory, then extracted like you said - "tar xzvf file.tar -C ./" and it followed the symlink and dumped the files in my test directory.


All times are GMT -5. The time now is 12:39 PM.