Skip to Content
Google Cloud Platform for Architects
book

Google Cloud Platform for Architects

by Vitthal Srinivasan, Loonycorn Ravi, Judy Raj
June 2018
Intermediate to advanced
372 pages
8h 44m
English
Packt Publishing
Content preview from Google Cloud Platform for Architects

Deleting objects permanently using gsutil

Just as you would use the rm command to delete a file on your own system, the gsutil rm command can be used to remove files and directories within a bucket:

  1. Use the gsutil rm command as follows to delete file(s) from the bucket. The command is followed by the source URL of the file and an optional -r to indicate removal of internal subdirectories along with files in a folder:
gsutil rm gs://loonycorn-bucket-00/image1.png
  1. Do not forget to add a file extension properly or the file shall not be deleted. Later, you can use the ls command to verify your deletion.
  2. Similarly, the rb command deletes the whole bucket, along with the files inside it.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Google Cloud Platform Professional Cloud Architect

Google Cloud Platform Professional Cloud Architect

Victor Dantas
Google Cloud Platform for Developers

Google Cloud Platform for Developers

Ted Hunter, Steven Porter

Publisher Resources

ISBN: 9781788834308Other