Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 08-30-2012, 02:55 AM   #1
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:

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, 05:06 AM   #2
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.


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 04:28 PM
Making a symlink follow its target when the target moves pwabrahams Linux - Software 3 03-08-2011 07:04 PM
[SOLVED] Is it possible to open a symlink (won't follow) and read data from it? lesca Programming 5 11-10-2010 06:08 AM
How to extract and install from .tar.gz and .tar.bz2 wstay Linux - Newbie 4 11-08-2008 10:14 AM
TAR Extract Question. swamprat Linux - Newbie 6 12-31-2006 10:17 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:48 PM.

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