<p>I have an app/pod: <code>app1</code> with 2 containers <code>service1</code> and <code>service2</code>. These services writes log at /var/log/app1Service1.log and /var/log/aapp1Service2.log. I'd like to tail log from mac's cli. Tried as below but did not work.</p>

<pre><code>~ $ kubectl exec app1-6f6749ccdd-4ktwf -c app1Service1 "tail -f -n +1 /var/log/app1Service1.log"
rpc error: code = 2 desc = oci runtime error: exec failed: container_linux.go:247: starting container process caused "exec: \"tail -f -n +1 /var/log/app1Service1.log\": stat tail -f -n +1 /var/log/app1Service1.log: no such file or directory"

command terminated with exit code 126
~ $
</code></pre>

<p>below command works:</p>

<pre><code>kubectl exec app1-6f6749ccdd-4ktwf -c app1Service1 ls
kubectl exec app1-6f6749ccdd-4ktwf -c app1Service1 "ls"
</code></pre>

<p>Seeing failures when I pass arguments to command. </p>

Robert Ranjan
<p>Add <code>bash -c</code> or if your container has <code>sh</code> then add <code>sh -c</code></p>

<pre><code>kubectl exec app1-6f6749ccdd-4ktwf -c app1Service1 -- bash -c "tail -f -n +1 /var/log/app1Service1.log"
</code></pre>

<p>Hope this'll help</p>
