Skip to content

Instantly share code, notes, and snippets.

@suhlig
Last active May 5, 2024 11:07
Show Gist options
  • Save suhlig/663870267edb478a08c840056324fd8c to your computer and use it in GitHub Desktop.
Save suhlig/663870267edb478a08c840056324fd8c to your computer and use it in GitHub Desktop.
Table of b2 buckets sorted by total size
b2 list-buckets --json \
| jq '.[].bucketName' \
| xargs -n 1 b2 get-bucket --showSize \
| jq -r --slurp '["name","size"], (.[] | [.bucketName, .totalSize]) | @csv' \
| qsv sort --numeric --reverse --select size \
| qsv table
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment