0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

【GCP】gsutil コマンドで GCS を操作するときによく使うやつ

Posted at

お金に注意して使っていきたい。

バケットの一覧を見る

gsutil ls -p プロジェクトID

特定のバケットの合計サイズを確認する

gsutil du -s gs://バケット名

全てのバケットの各々の合計サイズを確認する

gsutil du -s $(gsutil ls -p プロジェクトID)

出力バイト数をヒューマンリーダブルにする

-h を追加

gsutil du -hs $(gsutil ls -p プロジェクトID)

全てのバケットの合計サイズも出力する

-c を追加

gsutil du -chs $(gsutil ls -p プロジェクトID)

特定のバケットの特定のフォルダ以下の合計サイズを出力する

ワイルドカードを使う

gsutil du -hs gs://バケット名/フォルダ名/*

特定のバケットの特定のフォルダ配下を全て削除する

-m を付ける (multi-threaded/multi-processing)

gsutil -m rm -r gs://バケット名/フォルダ名
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?