Query, format and filter OpenShift resources

To list everything in the project use:

oc get all
To get only specific resource types, use them in the query:
oc get po
oc get deploy
To get the yaml of the resource:
oc get po first-app-6c5f898c87-rxmhl -o yaml
You can get the same output as json:
oc get po first-app-6c5f898c87-rxmhl -o json
Another way to get detailed information is to use describe:
oc describe po first-app-6c5f898c87-rxmhl
You can pipe to grep and look up for any resource attribute:
oc describe po first-app-6c5f898c87-rxmhl | grep IP
With oc get you can control which specific attributes are included in the output:
oc get po -o custom-columns=NAME:.metadata.name,RSRC:.metadata.labels
this prints just the name and attached labels to the pod

The oc command also support filtering resources using label selectors with -l flag:
oc get pod -l deployment=first-app
you can also filter using field-selector flag:
oc get pod --field-selector=status.phase=Running
g this will list the running pods