<p>A lot of times the commands I run look like</p>
<pre><code>kubectl get * | grep abc
</code></pre>
<p>but this way I can't see the first row (which is the column names), is there an easy alternative to this such that I'll see 2 rows (for resource <code>abc</code> and the column names)?</p>

Serge Vu
<p>Kubenertes already supported JSONPath so we can get any value 's field of a kubenertes object.</p>
<p>This is example when i want to get namespace of a pod:</p>
<pre><code>$ kubectl get pods -l app=app-demo --all-namespaces -o=jsonpath='{.items[0].metadata.namespace}'
demo%
</code></pre>
<p>You can get reference here: <a href="https://kubernetes.io/docs/reference/kubectl/jsonpath/" rel="noreferrer">JSONPath Support</a>.</p>
