get total size of Amazon S3 bucket or folder

aws s3 ls --summarize --human-readable --recursive s3://bucket/path/ | grep "Total Size" >> list.txt;