BruceWayne
BruceWayne

Reputation: 3374

How to reset Google Cloud Shell environment

I am trying to reset my Cloud Shell disk. I am deleting projects and creating new, but getting same cloud shell with all pre-installed files. Is there anyway to reset completely.

Upvotes: 4

Views: 17464

Answers (2)

Arne S
Arne S

Reputation: 1016

Yes there is

Restore your Cloud Shell home directory to a clean state:

Check for personal files in the home directory:
  ls -a $HOME
Remove all files from your home directory:
  sudo rm -rf $HOME
In the Cloud Shell menu, click the gear icon, then click Restart Cloud Shell. Click Restart Cloud Shell in the confirmation dialog.

From the docs https://cloud.google.com/shell/docs/resetting-cloud-shell

Upvotes: 12

Hakro
Hakro

Reputation: 2774

There seems to be no way to manually reset the cloud shell. According to the documentation, the cloud shell VM is terminated after one hour of inactivity. You might want to kill your session for that to take effect :

Cloud Shell Doc

But keep in mind that the cloud shell is not meant to be a full blown machine. It's more for testing and launching ad-hoc gcloud and gsutil commands.

So it's better to spin up a new Cloud Compute instance for your development purposes, instead of using the cloud Shell.

Upvotes: 0

Related Questions