title: Tar several files keeping directory tree
body: <p>Ive been looking at this for hours, and cant find a way to tar several files with directory structure ( tree )</p>
  
  <p>Example:</p>
  
  <p>I have files in:</p>
  
  <pre><code>1. /home/user/somefolder/file.txt
  2. /home/user/somefolder/file2.txt
  3. /home/user/somefolder/file3.txt
  4. /home/user/somefolder/somefolder2/file2.txt
  5. /home/user/somefolder/somefolder3/file3.txt
  </code></pre>
  
  <p>now i want to take files 1+4 and tar it.</p>
  
  <pre><code>tar cvzf file.tar.gz /home/user/somefolder/file.txt /home/user/somefolder/somefolder/file2.txt
  </code></pre>
  
  <p>but it takes those files and tar it into one file without keeping the second some folder while i want to tar file to look like this:
  tarfile</p>
  
  <pre><code>somefolder
  |-- file.txt
  |-- somefolder2
      |-- file2.txt
  </code></pre>