Skip to content

ls

List the contents of a bucket:

sh
s3m ls backup/backups

TIP

If using Cloudflare R2 you need to pass the prefix (option -p, --prefix), for example:

sh
s3m ls cloudflare/my-bucket --prefix test

To list available buckets:

sh
s3m ls backup

To list in-progress multipart uploads:

sh
s3m ls backup/backups --multipart

-p/--prefix

To list the content of a bucket with a specific prefix:

sh
s3m ls backup/backups --prefix test

-n/--number

Return only 3 results:

sh
s3m ls backup/backups --number 3

--older-than

List only objects whose LastModified is strictly older than the given duration:

sh
s3m ls backup/backups --older-than 30d

Supported duration forms:

  • Nd
  • Nh
  • Nm

--json

Return machine-readable JSON instead of terminal-formatted output:

sh
s3m ls backup/backups --json

Bucket listing also supports JSON:

sh
s3m ls backup --json

Released under the BSD License.