Skip to content

Instantly share code, notes, and snippets.

@johannesboyne
Created February 15, 2016 15:13
Show Gist options
  • Save johannesboyne/c2efc37903820d1f2093 to your computer and use it in GitHub Desktop.
Save johannesboyne/c2efc37903820d1f2093 to your computer and use it in GitHub Desktop.
#!/bin/bash
aws s3 ls --region=<region> <bucket-and-path> \
| sed '1d;$d' \
| awk '{print "s3://<bucket-and-path>/"$4 }' \
| xargs -L 1 -I file aws s3 cp --region=<region> file - \
| awk '{print $5}'|sort|uniq -c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment