<p>I am trying to use wildcard on <code>kubectl cp</code> command however its failling to recognise wildcard. </p>

<pre><code>$ kubectl cp mypod:/tmp/exampleFiles.* /tmp
tar: /tmp/exampleFiles.*: Cannot stat: No such file or directory
tar: Exiting with failure status due to previous errors
</code></pre>

<p>Although my Kubernetes is up to date (v1.15.2) and according to <a href="https://github.com/kubernetes/kubernetes/issues/78854" rel="nofollow noreferrer">this git issue</a> wildcard problem is fixed, but I am confused that why its not working for me. Is my syntax wrong? what do you think the problem is? please help!</p>

Saber
<p>For everyone's benefit, I am pasting working code as suggested by <strong>heyjared</strong> user on <a href="https://github.com/kubernetes/kubernetes/issues/78854" rel="nofollow noreferrer">https://github.com/kubernetes/kubernetes/issues/78854</a></p>
<pre><code>Use find with xargs as a workaround:

find . | xargs -i{} kubectl cp {} namespace/pod:path
</code></pre>
<p>It worked for me. I replaced &quot;.&quot; with my needed source path.</p>
<p><strong>Example:</strong></p>
<pre><code>find &lt;source_path&gt; | xargs -i{} kubectl cp {} namespace/pod:&lt;path_inside_pod&gt;
</code></pre>
<p>Like:</p>
<pre><code>find /var/tmp/data/ | xargs -i{} kubectl cp {} namespace/pod:/tmp/
</code></pre>
<p>This will copy all contents inside local /var/tmp/data/ directory and store it under /tmp/ inside pod.</p>
