gsutil返回“未找到匹配项" [英] gsutil returning "no matches found"

查看:88
本文介绍了gsutil返回“未找到匹配项"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用gsutil删除Cloud Storage存储桶(而不是存储桶本身)的内容.根据文档,命令应为:

I'm trying using gsutil to remove the contents of a Cloud Storage bucket (but not the bucket itself). According to the documentation, the command should be:

gsutil rm gs://bucket/**

但是,每当我运行它(当然用我的存储桶名称替换)时,都会收到以下响应:

However, whenever I run that (with my bucket name substituted of course), I get the following response:

zsh: no matches found: gs://my-bucket/**

我已经检查了权限,并且我拥有所有者权限.另外,如果我直接指定文件桶中的文件,则该文件将被成功删除.

I've checked permissions, and I have owner permissions. Additionally, if I specify a file, which is in the bucket, directly, it is successfully deleted.

其他可能重要的信息:

  • 我的存储桶名称中有一个-"(类似于"my-bucket")
  • 这是Cloud Storage将我的使用情况日志保存到的存储桶

如何删除存储桶中的内容?

How do I go about deleting the contents of a bucket?

推荐答案

zsh尝试在gsutil看到通配符之前对其进行扩展(并抱怨您没有与该通配符匹配的本地文件).请尝试这样做,以防止zsh这样做:

zsh is attempting to expand the wildcard before gsutil sees it (and is complaining that you have no local files matching that wildcard). Please try this, to prevent zsh from doing so:

gsutil rm 'gs://bucket/**'

请注意,您需要使用单引号(而不是双引号)来防止zsh通配符处理.

Note that you need to use single (not double) quotes to prevent zsh wildcard handling.

这篇关于gsutil返回“未找到匹配项"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆