What persists between Cloud Shell sessions?

Direct Answer (Verified)Reviewed by Sunny (Senior Cloud Engineer)

Correct Answer: Only files stored in the $HOME directory (/home/user), which is backed by a persistent 5 GB disk

Cloud Shell provides a persistent 5 GB home directory (`$HOME`) backed by a disk that persists across sessions. Files written outside `$HOME` (e.g., in `/tmp`, installed system pac...

๐Ÿ“‹Part of Professional Cloud Architect ยท GCP Certification Practice
Real Exam Scenario

What persists between Cloud Shell sessions?

โœ“ Correct Answer & Explanation

Correct Answer

Only files stored in the $HOME directory (/home/user), which is backed by a persistent 5 GB disk

Why This Answer Is Correct

Cloud Shell provides a persistent 5 GB home directory (`$HOME`) backed by a disk that persists across sessions. Files written outside `$HOME` (e.g., in `/tmp`, installed system packages via `apt`) are lost when the session ends โ€” the VM itself is ephemeral. This means you can persist scripts, SSH keys, `.bashrc`, `.gcloud` config, and project files in `$HOME`, but not globally installed tools (re-install them in `~/.bashrc` or use `cloudshell_open` startup scripts).