<p><code>kubectl get pods --all-namespaces</code> provides the list of all pods. The column <code>RESTARTS</code> shows the number of restarts that a pod has had. How to get the list of all the pods that have had at least one restart? Thanks</p>

<pre><code>kubectl get pods --all-namespaces | awk '$5&gt;0'
</code></pre>
<p>or simply just</p>
<pre><code>kubectl get po -A | awk '$5&gt;0'
</code></pre>
<p>Use awk to print if column 5 (RESTARTS) &gt; 0</p>
<p>or with the use of an alias</p>
<pre><code>alias k='kubectl'
k get po -A | awk '$5&gt;0'
</code></pre>
