<pre><code> kubectl cp namespace/podname:/path/target .
</code></pre>
<p>If I use the instructed command from kubernetes guide, it only copies the contents inside the <code>target</code> directory and omits <code>target</code> itself.<br />
I don't want to use <code>mkdir</code> every time I need to copy.<br />
What's the option?</p>

Lunartist
<p>I have a pod under <code>default</code> namespace called <code>ubuntu-pod</code> with a file located at root: <code>/decomission.log</code> and I got the same error:</p>
<pre class="lang-yaml prettyprint-override"><code>$ kubectl cp default/ubuntu-pod:/decommission.log decommission.log
tar: Removing leading `/' from member names
</code></pre>
<p>The solution was to remove the slash and then I was able to copy the file with no message:</p>
<pre class="lang-yaml prettyprint-override"><code>$ kubectl cp default/ubuntu-pod:decommission.log decommission.log
$ ls
decommission.log
</code></pre>
