It&#x27;s not quite the same as `cp -r`. Tar will create the directories if necessary, but it will also drop the files into an existing folder hierarchy. So you could use it to create&#x2F;update a few entries in an existing tree of files. For instance you could deploy updates to a website like this (locally):<p><pre><code>    cd ~&#x2F;src&#x2F;mysite &amp;&amp; tar cf - . | (cd &#x2F;var&#x2F;www&#x2F;public_html &amp;&amp; tar xvf -)
</code></pre>
or this (remotely):<p><pre><code>    cd ~&#x2F;src&#x2F;mysite &amp;&amp; tar czf - . | ssh mysite &#x27;tar xvzf - -C &#x2F;var&#x2F;www&#x2F;public_html&#x27;
</code></pre>
I would probably actually use rsync for this, but there have been times the tar approach came in handy.<p>A long time ago, in the dark ages of version control, I used to use tar for rollback-able deployments: I would create a tarball of the files in development to be deployed, and I would create a tarball of the files in production to be overwritten. Then I could just explode one tarball to deploy and the other to rollback. Not something I&#x27;d do today, but we didn&#x27;t always have such nice tools. :-)