title: Updating a single file in a compressed tar
body: <p>Given a compressed archive file such as <code>application.tar.gz</code> which has a folder <code>application/x/y/z.jar</code> among others, I'd like to be able to take my most recent version of <code>z.jar</code> and update/refresh the archive with it.</p>
  
  <p>Is there a way to do this other than something like the following?</p>
  
  <pre><code>tar -xzf application.tar.gz
  cp ~/myupdatedfolder/z.jar application/x/y
  tar -czf application application.tar.gz
  </code></pre>
  
  <p>I understand the <code>-u</code> switch in tar may be of use to avoid having to untar the whole thing, but I'm unsure how to use it exactly.</p>