{"id":297232,"date":"2021-07-13T00:00:00","date_gmt":"2021-07-12T21:00:00","guid":{"rendered":"https:\/\/en.buradabiliyorum.com\/how-to-get-the-size-of-an-amazon-s3-bucket-cloudsavvy-it\/"},"modified":"2021-07-13T00:00:00","modified_gmt":"2021-07-12T21:00:00","slug":"how-to-get-the-size-of-an-amazon-s3-bucket-cloudsavvy-it","status":"publish","type":"post","link":"https:\/\/buradabiliyorum.com\/en\/how-to-get-the-size-of-an-amazon-s3-bucket-cloudsavvy-it\/","title":{"rendered":"#How to Get the Size of an Amazon S3 Bucket \u2013 CloudSavvy IT"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_85 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-6a3e70e095227\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #dd3333;color:#dd3333\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #dd3333;color:#dd3333\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6a3e70e095227\" checked aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-get-the-size-of-an-amazon-s3-bucket-cloudsavvy-it\/#How_to_Find_Bucket_Size_from_the_GUI\" >How to Find Bucket Size from the GUI<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-get-the-size-of-an-amazon-s3-bucket-cloudsavvy-it\/#How_to_Get_Bucket_Size_from_the_CLI\" >How to Get Bucket Size from the CLI<\/a><\/li><\/ul><\/nav><\/div>\n<p><strong>&#8220;#How to Get the Size of an Amazon S3 Bucket \u2013 CloudSavvy IT&#8221;<\/strong><\/p>\n<div id=\"article-content-area\">\n<h3><img loading=\"lazy\" decoding=\"async\" class=\"type:primaryImage alignnone size-full wp-image-5269\" src=\"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2020\/06\/e601b806.png?width=1198&amp;trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"AWS Logo\" width=\"700\" height=\"300\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/h3>\n<p>AWS makes finding the size of an S3 bucket fairly unintuitive and hidden in the menus. Here\u2019s how to find the total size, graph it in CloudWatch, or fetch it programmatically from the command line.<\/p>\n<h2 role=\"heading\" aria-level=\"2\"><span class=\"ez-toc-section\" id=\"How_to_Find_Bucket_Size_from_the_GUI\"><\/span>How to Find Bucket Size from the GUI<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>From the <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/s3.console.aws.amazon.com\/?tag=reviewgeek-20\">S3 Management Console<\/a>, click on the bucket you wish to view. Under Management &gt; Metrics &gt; Storage, there\u2019s a graph that shows the total number of bytes stored over time.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"imgchk9 alignnone wp-image-1760 size-full\" src=\"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2019\/09\/89734f82.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Find size bucket through GUI\" width=\"700\" height=\"200\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>Additionally, you can view this metric in <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/aws.amazon.com\/cloudwatch\/?tag=reviewgeek-20\">CloudWatch<\/a>, along with the number of objects stored. You can use this to add the bucket size to a graph in a CloudWatch dashboard.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"imgchk9 alignnone wp-image-1761 size-full\" src=\"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2019\/09\/0a7b8575.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"View bucket size metric in CloudWatch.\" width=\"700\" height=\"299\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>From the bucket overview page, you can also select all items, and choose Actions &gt; Get Total Size. But, if you have more than one page of items, you can\u2019t select everything, and it won\u2019t be representative of the bucket\u2019s actual size.<\/p>\n<p>You can also view the bucket\u2019s size from the <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/docs.aws.amazon.com\/awsaccountbilling\/latest\/aboutv2\/ce-getting-started.html?tag=reviewgeek-20\">Cost Explorer<\/a>, because the billing department will, of course, have a very accurate measurement of your usage.<\/p>\n<h2 role=\"heading\" aria-level=\"2\"><span class=\"ez-toc-section\" id=\"How_to_Get_Bucket_Size_from_the_CLI\"><\/span>How to Get Bucket Size from the CLI<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>You can list the size of a bucket using the AWS CLI, by passing the <code>--summarize<\/code>\u00a0flag to <code>s3 ls<\/code>:<\/p>\n<pre>aws s3 ls s3:\/\/bucket --recursive --human-readable --summarize<\/pre>\n<p>This will loop over each item in the bucket, and print out the total number of objects and total size at the end. If you\u2019d like to not have your terminal flooded with every filename in your bucket, you can pass the output to <code>tail<\/code>:<\/p>\n<pre>aws s3 ls s3:\/\/bucket --recursive --human-readable --summarize | tail -2<\/pre>\n<p>This will take a while if you have a very large bucket. You could use <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/docs.aws.amazon.com\/cli\/latest\/reference\/cloudwatch\/get-metric-data.html?tag=reviewgeek-20\"><code>get-metric-data<\/code><\/a>\u00a0to fetch the size from CloudWatch, but the syntax is clunky.<\/p>\n<p>An easier method is to install <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/s3tools.org\/\">s3cmd<\/a>; It\u2019s not a part of the AWS CLI, so you\u2019ll have to manually install it from your distro\u2019s package manager. For Debian-based systems like Ubuntu, that would be:<\/p>\n<pre>sudo apt-get install s3cmd<\/pre>\n<p>Once <code>s3cmd<\/code> is installed, you\u2019ll need to run the following command to link it to your account with your access key (you can generate a new one from \u201cMy Security Credentials\u201d):<\/p>\n<pre>s3cmd --configure<\/pre>\n<p>Once it\u2019s installed, you can get the size of all of your buckets quickly with:<\/p>\n<pre>s3cmd du -H&#13;\n&#13;\n5.708148956298828M 2 objects s3:\/\/bucket\/<\/pre>\n<p>This will display the size of large buckets much faster than recursively summing file sizes will, as it fetches the actual disk space used. Plus, it\u2019s human readable if you pass the <code>-H<\/code>\u00a0flag, so you won\u2019t have to break out your calculator.\n<\/div>\n<blockquote><p><strong><span style=\"color: #ff6600;\">If you liked the article, do not forget to share it with your friends. Follow us on\u00a0<span style=\"color: #ff0000;\"><a style=\"color: #ff0000;\" href=\"https:\/\/news.google.com\/publications\/CAAqBwgKMLG0nwswvr63Aw\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Google News<\/a><\/span>\u00a0too, click on the star and choose us from your favorites.<\/span><\/strong><\/p><\/blockquote>\n<blockquote>\n<p style=\"text-align: center;\">For forums sites go to <span style=\"color: #ff9900;\"><a style=\"color: #ff9900;\" href=\"https:\/\/forum.buradabiliyorum.com\/\" target=\"_blank\" rel=\"noopener\">Forum.BuradaBiliyorum.Com<\/a><\/span><\/strong><\/p>\n<\/blockquote>\n<blockquote>\n<p style=\"text-align: center;\"><strong>If you want to read more like this article, you can visit our <span style=\"color: #ff9900;\"><a style=\"color: #ff9900;\" href=\"https:\/\/en.buradabiliyorum.com\/technology\/\" target=\"_blank\" rel=\"noopener\">Technology category.<\/a><\/span><\/strong><\/p>\n<\/blockquote>\n<p><span style=\"color: black;\"><a style=\"color: #ff9900;\" href=\"https:\/\/www.cloudsavvyit.com\/1755\/how-to-get-the-size-of-an-amazon-s3-bucket\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8220;#How to Get the Size of an Amazon S3 Bucket \u2013 CloudSavvy IT&#8221; AWS makes finding the size of an S3 bucket fairly unintuitive and hidden in the menus. Here\u2019s how to find the total size, graph it in CloudWatch, or fetch it programmatically from the command line. How to Find Bucket Size from the&#8230;<\/p>\n","protected":false},"author":1,"featured_media":297233,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"fifu_image_url":"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2020\/06\/e601b806.png","fifu_image_alt":"","footnotes":""},"categories":[18],"tags":[],"class_list":["post-297232","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-technology"],"_links":{"self":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts\/297232","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/comments?post=297232"}],"version-history":[{"count":0,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts\/297232\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/media\/297233"}],"wp:attachment":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/media?parent=297232"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/categories?post=297232"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/tags?post=297232"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}