OpenShift - List projects using the oc get projects command

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.

The oc config view or oc get apiserver commands can be used to display the API Server URL ( in this example).

oc get projects

You have access to the following projects and can switch between them with 'oc project <projectname>':

 * project2
   et cetera

Using project "project2" on server "".


The -q or --short flag can be used to display only the project names.

~]# oc get projects --short


--short=false can be used to return something like this.

oc get projects --short=false

Using project "project2" on server "".


Add a Comment

We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.

Please enter d3fb0 in the box below so that we can be sure you are a human.


Web design by yours truely - me, myself, and I   |   |