Last active
July 6, 2026 08:57
-
-
Save do-me/c73472befaf1cbe808136e2a4a3c0ed4 to your computer and use it in GitHub Desktop.
Useful aws s3 commands
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # clone folder from s3 to local recursively | |
| aws s3 cp s3://some_folder ./some_folder/ --recursive | |
| # get recursive size of folder on s3, human readable | |
| aws s3 ls s3://some_folder/ \ | |
| --recursive --summarize | | |
| awk ' | |
| /Total Objects/ {print} | |
| /Total Size/ { | |
| size=$3 | |
| split("B KiB MiB GiB TiB PiB", u) | |
| i=1 | |
| while (size>=1024 && i<6) { size/=1024; i++ } | |
| printf " Total Size: %.2f %s\n", size, u[i] | |
| }' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment