英文:
Cannot delete file within bucket
问题
rm: 无法删除 'file.txt': 权限被拒绝
这是我的存储桶权限。
英文:
username@instance-1:~/my_bucket$
rm: cannot remove 'file.txt': Permission denied
Here's my permissions for the bucket.
答案1
得分: 1
以下是已翻译的内容:
有两个主要因素可以阻止您删除存储桶中的对象(文件):
正如@guillaume blaquiere也提到的:
权限或保留策略可能会阻止您删除存储桶中的对象。
关于您提到的rm
命令无法正常工作的问题,是因为普通的rm
命令无法与像Google Cloud Storage这样的云存储服务一起使用,因为rm
设计用于从本地文件系统中删除文件和目录,而不是从云存储中删除。
当您在终端中使用rm
时,它只能删除存储在本地计算机上的文件和目录。它无法与云存储服务互动或从云存储存储桶中删除对象。
对于云存储互动,您需要使用云存储服务提供的特定命令。在Google Cloud Storage的情况下,您使用的gsutil rm
命令可以正常工作。
获取更多信息和参考资料:rm - 删除对象
英文:
There are two main factors that can prevent you from deleting objects (files) in a bucket:
As mentioned also by @guillaume blaquiere:
> Permissions or retention policies can prevent you from deleting objects in a bucket.
Regarding your question about rm
not working is because the normal rm
command doesn't work with cloud storage services like Google Cloud Storage because rm
is designed to remove files and directories from the local file system, not from cloud storage.
When you use rm
in the terminal, it can only delete files and directories stored locally on your machine. It doesn't have the ability to interact with cloud storage services or delete objects from cloud storage buckets.
For cloud storage interactions, you need to use specific commands provided by the cloud storage service. In the case of Google Cloud Storage, the gsutil rm
command you used worked.
For more information and reference: rm - Remove objects
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论