title: Kubectl exec command to write contents to a file in the pod
body: <p>I am trying below command</p>
  
  <pre><code>kubectl exec -it sss-pod-four  echo "hi" &gt;&gt; /mnt/sss/testnew.txt
  </code></pre>
  
  <p>But it throws error</p>
  
  <pre><code>-bash: /mnt/sss/testnew.txt: No such file or directory
  </code></pre>
  
  <p>What is the best way to achieve this</p>