Skip to content

Instantly share code, notes, and snippets.

@crashGoBoom
Created September 30, 2020 16:43
Show Gist options
  • Save crashGoBoom/9f7a5701f4c67b4e877027865f1fa403 to your computer and use it in GitHub Desktop.
Save crashGoBoom/9f7a5701f4c67b4e877027865f1fa403 to your computer and use it in GitHub Desktop.
aws s3 get bucket by name prefix
#!/bin/bash
# Usage: ./get_bucket_byprefix.sh "someprefix"
_prefix="${1}"
aws s3api list-buckets --query "Buckets[?starts_with(Name,'${_prefix}')].Name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment