【问题标题】:`gsutlis ls` can't show bucket list`gsutlis ls` 无法显示存储桶列表
【发布时间】:2021-12-28 03:32:12
【问题描述】:

我有 2 台 Mac 笔记本电脑。在这个问题中,我称它们为“MacA(工作正常)”和“MacB(奇怪的行为)”。

MacB 发生了什么?

  1. gsutils ls的结果

    MacA(工作正常)

    $ gsutil ls
    gs://bucket-a
    gs://bucket-b
    gs://bucket-c
    

    MacB(奇怪的行为)

    $ gsutil ls
    CommandException: Incorrect option(s) specified. Usage:
    
      gsutil ls [-a] [-b] [-d] [-l] [-L] [-r] [-p proj_id] url...
    
    For additional help run:
      gsutil help ls
    
  2. gsutls help ls的结果

    MacA(工作正常)

    $ gsutil help ls
    NAME
      ls - List providers, buckets, or objects
    
    SYNOPSIS
    
      gsutil ls [-a] [-b] [-d] [-l] [-L] [-r] [-p proj_id] url...
    
    LISTING PROVIDERS, BUCKETS, SUBDIRECTORIES, AND OBJECTS
      If you run gsutil ls without URLs, it lists all of the Google Cloud Storage
      buckets under your default project ID (or all of the Cloud Storage buckets
      under the project you specify with the -p flag):
    
        gsutil ls
    
      If you specify one or more provider URLs, gsutil ls lists buckets at each
      listed provider:
      ......
    

    MacB(奇怪的行为)

    $ gsutil help ls
    CommandException: The help command accepts at most 2 arguments. Usage:
    
      gsutil help [command or topic]
    
    For additional help run:
      gsutil help help
    
  3. shasum ~/google-cloud-sdk/bin/gsutil

    ~/google-cloud-sdk/bin/gsutil 的校验和在 MacA 和 MacB 之间是相同的。

【问题讨论】:

    标签: google-cloud-platform google-cloud-storage gsutil


    【解决方案1】:

    我解决了这个问题。

    我的 .zshrc 配置错误。我删除了-g 选项。

    alias -g ls="ls -F -G"

    alias ls="ls -F -G"

    在我更改.zshrc之前,gsutil ls 无意中被替换为gsutils ls -F -G

    【讨论】:

      猜你喜欢
      • 2021-04-26
      • 2017-10-23
      • 2022-01-24
      • 2019-05-31
      • 2016-06-18
      • 2016-11-13
      • 1970-01-01
      • 2020-08-31
      相关资源
      最近更新 更多