Issue
If have a command kubectl get pods -n test
which lists:
abcd-123-ghbv
abcd-123-ghbv
abcd-123-ghbv
text-123-ghbv
abcd-123-ghbv
abcd-123-text
How can I use grep
(or another command) along with the line kubectl get pods -n test
to filter result containing text
? The end result would be:
text-123-ghbv
abcd-123-text
I see that piping with findstr
is one option. However I would like to do it with a native command.
Solution
Pipe using grep as follow:
kubectl get pods -n test | grep text
Answered By - Dante Answer Checked By - Senaida (WPSolving Volunteer)