How to determine the number of objects in an s3 bucket

You can find the number of objects in an S3 bucket by running the below command from AWS CLI where bucketname is the name of the bucket.

aws s3 ls s3://bucketname/ --recursive | wc

See also  How to get current timestamp in Redshift database