title: Unix tar: do not preserve full pathnames
body: <p>When I try to compress files and directories with <code>tar</code> using absolute paths, the absolute path is preserved in the resulting compressed file. I need to use absolute paths to tell <code>tar</code> where the folder I wish to compress is located, but I only want it to compress that folder – not the whole path.</p>
  
  <p>For example, <code>tar -cvzf test.tar.gz /home/path/test</code> – where I want to compress the folder <code>test</code>. However, what I actually end up compressing is <code>/home/path/test</code>. Is there anything that can be done to avoid this? I have tried playing with the -C operand to no avail.</p>