Sometimes you need to quickly count the number and total size of a certain type of file in an S3 bucket, such as .jpg or .png image objects. If the bucket has versioning enabled, historical versions also need to be included. This kind of requirement may not be suitable for waiting on S3 Inventory — streaming the count directly with AWS CLI is faster.
4/25/26About 1 min
