Skip to content

Instantly share code, notes, and snippets.

@yarick
Created March 10, 2020 14: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 yarick/62b2eecd793e1c14b260a5e63b086364 to your computer and use it in GitHub Desktop.
Save yarick/62b2eecd793e1c14b260a5e63b086364 to your computer and use it in GitHub Desktop.
Search all AWS S3 buckets in account recursively for a folder or a file recursive recursion
#!/bin/bash
for i in $(aws s3api list-buckets --query "Buckets[].Name"| grep \"| awk -F\" '{print $2}'); do echo; echo $i; aws s3api list-objects --bucket $i --query "Contents[?contains(Key, 'i-my_super_secret_result_filie.json')]" ; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment