Skip to content

Instantly share code, notes, and snippets.

@AndrewSavetchuk
Last active February 25, 2023 06:03
Embed
What would you like to do?

Show a List of Files in a S3 Bucket

aws s3 ls --summarize --human-readable --recursive s3://BUCKET_NAME

Show a List of Files in a S3 Bucket Sorted by Size and Created After a Specific Date

The command below will show the last 5 files created after YYYY-MM-DD and sorted by size.

aws s3api list-objects-v2 --bucket BUCKET_NAME --query 'sort_by(Contents[?LastModified>=`YYYY-MM-DD`], &Size)[-5:]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment