Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@AndrewSavetchuk
Last active March 12, 2024 04:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AndrewSavetchuk/dbfd78a9e9b78eb241efcc117421b877 to your computer and use it in GitHub Desktop.
Save AndrewSavetchuk/dbfd78a9e9b78eb241efcc117421b877 to your computer and use it in GitHub Desktop.

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