Google Certified Associate Cloud Engineer 2020

Sign Up Free or Log In to participate!

file removed from the cloud storage does not appear with ls -a

I have copied a file in bucket folder and then tried to removed it using "gsutil rm gs://storage-lab-cli2210/README-cloudshell.txt" but if I do a list with "a" the file is not there.

Here is the output:

gcpuser2211@cloudshell:~ (my-user-2-project)$ gsutil ls -a gs://storage-lab-cli2210




gcpuser2211@cloudshell:~ (my-user-2-project)$ gsutil rm gs://storage-lab-cli2210/README-cloudshell.txt   

Removing gs://storage-lab-cli2210/README-cloudshell.txt…

/ [1 objects]

Operation completed over 1 objects.

gcpuser2211@cloudshell:~ (my-user-2-project)$ gsutil ls -a gs://storage-lab-cli2210



<but now i do not see it here, it should be here,yeah?>

1 Answers

Hello, Amit!  I’m glad you got past the blocking billing issue. 🙂👍

For this situation, are you sure that you’ve successfully turned on versioning for this bucket? If you run gsutil versioning get gs://storage-lab-cli2210, does it show Suspended or Enabled?  Timecode @7:35 in the video linked to this question has a demo of this.

If versioning is turned off, the file will simply be deleted.  But if versioning is turned on, then the file should still show up with the gsutil ls -a gs://storage-lab-cli2210 command.



Amit J

Hello Mattias: Thanks for helping me out on billing issue, I really appreciate it. I now remember you showed the versioning part in your video and I think i totally lost to enable it. Sorry for the false alarm. I followed the video again and now the things are working as expected. Thanks again for your time and detailed explanation. Cheers! —Amit J

Mattias Andersson

No problem. Glad to help again. 🙂

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?