How to list contents of an S3 bucket

How to list contents of an S3 bucket?

You can list contents of an S3 bucket using AWS CLI, boto3 or any other SDK provided by AWS.

List content of an S3 bucket using AWS CLI:

List all files (objects) and folders (keys) in an S3 bucket using AWS CLI

List all files (objects) and folders (keys) in a specific folder (key)in S3 bucket using AWS CLI

List all files (objects) with specific extension in an S3 bucket using AWS CLI

List content of an S3 bucket using boto3:

Keep <YOUR_FOLDER_PATH> blank if you want to list the entire S3 bucket, change the extension from .json to any other as per your requirements.

You can use below links to install and configure AWS CLI and boto3

https://cloudaffaire.com/how-to-install-aws-cli/

https://cloudaffaire.com/how-to-configure-aws-cli/

https://cloudaffaire.com/how-to-install-python-boto3-sdk-for-aws/

https://cloudaffaire.com/how-to-configure-python-boto3-sdk-for-aws/

Hope this solves your issue, keep learning and keep sharing.

Debjeet

Leave a Reply