Last active
March 18, 2026 16:33
-
-
Save ikurni/3875e9c43861dd26a0b384e5e60479ef to your computer and use it in GitHub Desktop.
OCP Command Cheatsheets
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ### Nested Loops | |
| #for i in $(oc get project | grep -i -v '^openshift\| ^kube' | awk '{print $1}'); do for y in $(oc get pods -n $i | grep -i completed | awk '{print $1}'); do oc delete pods $y -n $i; done; done | |
| ### Force Delete all terminating pods in all Namespaces | |
| #oc get pods -A | grep Terminating | awk '{print "oc delete pod " $2 " -n " $1 " --force --grace-period=0"}' | sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment