title: How to prevent tar extraction from overwriting symbolic links directories
body: <p>Note:Overwriting of the symlinks occurs from tar version 1.27 or higher</p>
  
  <p>Below I am trying to show what exactly the problem is.</p>
  
  <p>contents of the dirtmp1</p>
  
  <pre><code>file1.txt
  file2.txt
  </code></pre>
  
  <p>code to create the above directory </p>
  
  <pre><code>rm -f -r dirtmp1 &amp;&amp; mkdir dirtmp1 &amp;&amp; cd dirtmp1 &amp;&amp; touch file1.txt &amp;&amp; touch file2.txt &amp;&amp; ls -al
  </code></pre>
  
  <p>creating a symbolic link</p>
  
  <pre><code>cd ..
  ln -s dirtmp1/ symlink1
  </code></pre>
  
  <p>now create the tar file which contains the name as symlink1</p>
  
  <pre><code>mkdir dirtmp1
  cd dirtmp1
  mkdir symlink1 &amp;&amp; cd symlink1 &amp;&amp; touch iNeedThisfile.txt &amp;&amp; cd .. &amp;&amp; tar -cvzf symlink1.tar.gz symlink1/
  </code></pre>
  
  <p>Extract the tar file in folder(symlnk1) is overwriting the symbolic link. All I want is preserve the symbolic link and copy the "iNeedThisfile.txt"</p>
  
  <p>After running this command <code>tar -xvf symlink1.tar.gz</code> </p>
  
  <p><code>symlink1:
  total 0
  -rw-r--r-- 1 root root 0 Mar 24 18:14 iNeedThisfile.txt</code></p>
  
  <p>Any flags while extracting which preserves the symbolic links while extracting. and copies the files to the folder pointed by the symbolic link.</p>
  
  <p>I apologise for not able to convey my message in fewer lines of text.</p>