OpenShift - Delete Project using the oc delete project command

by
Jeremy Canfield |
Updated: June 16 2022
| OpenShift articles
If you are not familiar with the oc command, refer to OpenShift - Getting Started with the oc command.
Before you can use the oc projects command, you must first login using the oc login command.
Before deleting a project, you'll probably want to use the oc get projects command to list the available and currently selected project. Let's say the oc get projects command returns the following, which indicates that project2 is the currently selected project.
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 oc delete project command can be used to delete a project. In this example, project3 will be deleted.
oc delete project project3
Something like this should be displayed.
project.project.openshift.io "project3" deleted
Did you find this article helpful?
If so, consider buying me a coffee over at