If you are not familiar with the oc command, refer to OpenShift - Getting Started with the oc command.
Before you can use the projects command, you must first login using the oc login command.
The oc get projects command will list the available projects, like this. The * character is used to indicate the current project being used.
oc get projects You have access to the following projects and can switch between them with 'oc project <projectname>': project1 * project2 project3 et cetera Using project "project2" on server "https://api.openshift.example.com:6443".
The -q or --short flag can be used to display only the project names.
~]# oc get projects --short project1 project2 project3
--short=false can be used to return something like this.
oc get projects --short=false Using project "project2" on server "https://api.openshift.example.com:6443".