Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kubectl get pods - How to filter pods by partial name [closed]

The command kubectl get pods <POD NAME> will return the specific pod with that name. I wonder if there is a way that I can use part of the name, for instance, a command that returns all pods that start with j.

like image 508
Kiarash Alinasab Avatar asked Sep 02 '25 02:09

Kiarash Alinasab


1 Answers

In Linux Bash:

kubectl get pods | grep ^j

In Windows PowerShell:

kubectl get pods | Select-String '^j'
like image 158
Kiarash Alinasab Avatar answered Sep 05 '25 01:09

Kiarash Alinasab