How to run AWS list objects

Updated on December 10th, 2022

Pre-requisites

Running AWS list objects

  1. First, open Command Prompt as an Administrator (this can be done by right-clicking on the application and selecting Run as Administrator).
  2. With Command Prompt open, type in aws configure (as shown below) and press Enter:
  3. You will then be asked for the Access Key, Secret Key, Region, and Output. Fill in each line and press Enter. For Output, you can leave this blank and hit Enter.
  4. If you wish to change the location where the text file will be saved, please change the directory now via the CD command.
  5. Type in the following command:
    aws s3api list-objects-v2 --bucket BUCKET-NAME -prod --prefix "FOLDER/PREFIX NAME"/ --query "Contents[].{Key: Key}" --encoding-type url --output text >> MyTextFile.txt
  6. It is important that you use speech marks around your prefix and that you end the prefix with a /.


If you are planning to ingest the listed objects, see the guide here on how to convert to CSV and Ingest: https://ipv.helpjuice.com/aws/1553659?from_search=99476071


Was this article helpful?