Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lsb - List S3 and GCS Bucket Contents

A fast CLI tool to list and calculate sizes of objects in S3 and GCS buckets.

Installation

cargo install --path .

Or download a prebuilt release from GitHub.

Usage

# 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

Options

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)

Output

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)

Authentication

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.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages