LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-30-2012, 03:55 AM   #1
McZ
Member
 
Registered: Aug 2012
Posts: 46

Rep: Reputation: Disabled
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?
 
Old 08-30-2012, 06:06 AM   #2
zQUEz
Member
 
Registered: Jun 2007
Distribution: Fedora, RHEL, Centos
Posts: 294

Rep: Reputation: 54
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to search for a pattern of a tar ball and pipe that name to tar to extract linux_newb Linux - General 2 02-27-2012 05:28 PM
Making a symlink follow its target when the target moves pwabrahams Linux - Software 3 03-08-2011 08:04 PM
[SOLVED] Is it possible to open a symlink (won't follow) and read data from it? lesca Programming 5 11-10-2010 07:08 AM
How to extract and install from .tar.gz and .tar.bz2 wstay Linux - Newbie 4 11-08-2008 11:14 AM
TAR Extract Question. swamprat Linux - Newbie 6 12-31-2006 11:17 AM


All times are GMT -5. The time now is 02:50 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration