A fast CLI tool to list and calculate sizes of objects in S3 and GCS buckets.
cargo install --path .Or download a prebuilt release from GitHub.
# List objects in a bucket prefix
lsb s3://my-bucket/2020
# Filter by key name
lsb s3://my-bucket/2020 -f mars
# List objects and show total size at the end
lsb s3://my-bucket/2020 --size
# Filter by size (supports K, M, G, T suffixes)
lsb s3://my-bucket/2020 --min-size 1M --max-size 10G
# Single level listing (like `aws s3 ls`)
lsb s3://my-bucket/2020 --no-recursive| Flag | Description |
|---|---|
-f, --filter |
Filter objects by key containing string |
--min-size |
Minimum object size (e.g., 1K, 1M, 1G) |
--max-size |
Maximum object size (e.g., 1K, 1M, 1G) |
--size |
Show object sizes when listing |
--binary-size |
Use binary units (TiB, GiB, MiB, KiB) for sizes |
-1, --no-recursive |
Single level listing (no recursive) |
By default, output shows:
- Object key (left-aligned, auto-sized column)
- Summary line: "N objects, total: X"
With --size, also shows:
- Object size (formatted: bytes, K, M, G, T or with
--binary-size: KiB, MiB, GiB, TiB)
AWS S3: Set AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables, or use AWS credentials configured via aws configure.
Google Cloud Storage: Authenticate via gcloud auth application-default login or set GOOGLE_APPLICATION_CREDENTIALS to a service account JSON file.