ls-s3.sh:
#!/bin/bash
DATE=$1 || $(date +%Y-%m-%d)
echo "List records for date $DATE"
aws s3 ls s3://bucket-name/directory/ | grep ${DATE}
./ls-s3.sh
- Defaults to todays date./ls-s3.sh 2019-07-15
- Argument date
aws s3api list-objects-v2 --bucket "bucket-name" --prefix "record-prefix" --query "Contents[?contains(LastModified, '2019-07-15')].{key: Key, date: LastModified}"
aws s3api list-objects-v2 --bucket "bucket-name" --prefix "record-prefix" --query "Contents[?LastModified>='2019-07-15'].{key: Key, date: LastModified}"
@pandeyvinod Yes it will work for large number of objects.