I'm trying to follow this tutorial. It seems that if I open a "cloud shell" in the browser, I can execute commands such as cd <cloud path>
without any issues. However, when I try to do so from my laptop terminal I run into issues:
(base) user ~ % gsutil ls
gs://my_project/
(base) user ~ % cd gs://my_project/
cd: no such file or directory: gs://my_project/
(base) user ~ % gsutil cd gs://my_project/
CommandException: Invalid command "cd".
(base) user ~ % gcloud cd gs://my_project/
ERROR: (gcloud) Invalid choice: 'cd'.
How should one change cloud directories from a local terminal, using gcloud SDK?
The program gsutil
does not support the concept of a current working directory
. Objects are specified using the full path <protocol><bucket><object-name>
.
If you install the package gcsfuse
, you can mount a Google Cloud Storage bucket as a directory. Then you can use the Linux shell command cd
to move around the bucket as a file system.
This article shows how to set up gcsfuse on Cloud Shell: