You are using Cloud Shell and need to install a custom utility for use in a few weeks. Where can you store the file so it is in the default execution path and persists across sessions?
A is correct
https://cloud.google.com/shell/docs/how-cloud-shell-works
Cloud Shell provisions 5 GB of free persistent disk storage mounted as your $HOME directory on the virtual machine instance. This storage is on a per-user basis and is available across projects. Unlike the instance itself, this storage does not time out on inactivity. All files you store in your home directory, including installed software, scripts and user configuration files like .bashrc and .vimrc, persist between sessions. Your $HOME directory is private to you and cannot be accessed by other users.
Won’t the persistent disk be auto-delete enabled by default, whereby the work maybe lost. Would that not be sufficient reason to consider Cloud storage instead. Thanks
The virtual machine instance that backs your Cloud Shell session is not permanently allocated to a Cloud Shell session and terminates if the session is inactive for an hour. After the instance is terminated, any modifications that you made to it outside your $HOME are lost.
Well, I just double checked and if they were referring to the PATH variable then /usr/local/bin is also a correct answer........................................
1. Cloud Shell's home directory: ~/bin is a subdirectory within your Cloud Shell home directory. Files placed in this directory are automatically added to your PATH environment variable, making them accessible from anywhere in your Cloud Shell session.
2. Persistence: Your Cloud Shell home directory is persistent across sessions. This means any files you store there, including those in ~/bin, will remain available even if you close and reopen Cloud Shell.
3. Convenience: This option is the most straightforward. It doesn't require any extra configuration or interaction with other services.
Why D i snot correct? because /usr/local/bin: is a common directory for system-wide binaries, but in Cloud Shell, your home directory's
1. When logging in to cloud shell for the first time, the ~/bin directory does not exist
2. mkdir ~/bin
3. After re-login to the cloud shell, $PATH will automatically add ~/bin
So A is the correct answer
At this moment default directory cant be set as Cloud storage bucket, so no C.
A will be correct as zonal PD with preinstalled tools 5gb available that does not timeout!
The recommended location for storing a custom utility file that you want to use in Cloud Shell and that should be in the default execution path and persist across sessions is option A: ~/bin.
The ~/bin directory is a personal directory that is in the default execution path for all users in Cloud Shell. Any executable files that you place in this directory will be available to you whenever you log in to Cloud Shell, and they will persist across sessions.
Option B: Cloud Storage is not a suitable location for storing a custom utility file that you want to use in Cloud Shell, as it is not in the default execution path and would require additional steps to make it accessible.
Option C: The /google/scripts directory is not a suitable location for storing a custom utility file, as it is not in the default execution path and is intended for use by Google Cloud system processes.
Option D: The /usr/local/bin directory is a system directory that is in the default execution path for all users, but it is not a suitable location for storing a custom utility file, as any files that you place in this directory may be deleted or overwritten during system updates.
Cloud Shell provisions 5 GB of persistent disk storage mounted as your $HOME directory on the Cloud Shell instance. All files you store in your home directory, including scripts and user configuration files like .bashrc and .vimrc, persist between sessions.
Reference- https://cloud.google.com/shell/?utm_source=google&utm_medium=cpc&utm_campaign=japac-IN-all-en-dr-bkwsrmkt-all-all-trial-e-dr-1009882&utm_content=text-ad-none-none-DEV_c-CRE_442449534611-ADGP_Hybrid%20%7C%20BKWS%20-%20EXA%20%7C%20Txt%20~%20Management%20Tools%20~%20Cloud%20Shell_cloud%20shell-general%20-%20Products-KWID_43700054972141701-kwd-837034669893&userloc_9302140-network_g&utm_term=KW_gcp%20cloud%20shell&gclsrc=ds&gclsrc=ds
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
ffk
Highly Voted 5 years, 1 month agoJambalaja
3 years, 8 months agozanfo
3 years, 3 months agoAzureDP900
2 years, 2 months agoakoti
4 years, 1 month agozanfo
3 years, 3 months agoShabje
4 years, 7 months agokaush
4 years, 6 months agozanfo
3 years, 3 months agoEroc
Highly Voted 5 years, 1 month agoRobertArnaud
Most Recent 1 week, 3 days agoEkramy_Elnaggar
1 month agothewalker
1 year, 1 month agoheretolearnazure
1 year, 4 months agomoota
1 year, 10 months agoFlight1976
1 year, 6 months agoFI22
1 year, 11 months agoomermahgoub
2 years agoomermahgoub
2 years agoJailbreaker
2 years, 1 month agomegumin
2 years, 1 month agominmin2020
2 years, 2 months agovpatiltech
2 years, 10 months agoOrangeTiger
2 years, 11 months agovincy2202
2 years, 12 months agoexam_war
3 years, 1 month agoMamthaSJ
3 years, 5 months ago