{"id":5184,"date":"2020-07-04T05:55:49","date_gmt":"2020-07-04T05:55:49","guid":{"rendered":"https:\/\/pariswells.com\/blog\/?p=5184"},"modified":"2021-07-04T05:59:26","modified_gmt":"2021-07-04T05:59:26","slug":"aws-folder-prefixes","status":"publish","type":"post","link":"https:\/\/pariswells.com\/blog\/research\/aws-folder-prefixes","title":{"rendered":"AWS \\ Folder \\ Prefixes"},"content":{"rendered":"<p>When you manipulate items in windows explorer from AWS s3 bucket , it creates folders which then get uploaded to AWS as 0 byte objects.\u00a0<\/p><p>You can view these in powershell by using\u00a0<\/p><p>Get-S3Object -BucketName &#8220;XXXXXX&#8221; -keyprefix &#8220;documents\/XXXXX\/XXXXX\/&#8221; | where-object {$_.Size -eq 0 -and $_.Key -like &#8220;XXXX\/XXXX\/XXXX\/12*&#8221;}<\/p><p>To remove ( You can only items 1000 at a time ) you can use the below<\/p><p>Remove-S3Object -bucketname &#8220;XXXXXX&#8221; -KeyCollection (Get-S3Object -BucketName &#8220;XXXXXX&#8221; -keyprefix &#8220;documents\/XXXXX\/XXXXX\/&#8221; | where-object {$_.Size -eq 0 -and $_.Key -like &#8220;XXXX\/XXXX\/XXXX\/12*&#8221;}| select -ExpandProperty Key)<\/p>","protected":false},"excerpt":{"rendered":"<p>When you manipulate items in windows explorer from AWS s3 bucket , it creates folders which then get uploaded to AWS as 0 byte objects.\u00a0You can view [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[3526,2242,3528,840,3524,3525,3527],"class_list":["post-5184","post","type-post","status-publish","format-standard","hentry","category-research","tag-0-byte-objects","tag-aws","tag-bucket","tag-folder","tag-prefix","tag-remove-empty-folders","tag-s3"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts\/5184","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/comments?post=5184"}],"version-history":[{"count":1,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts\/5184\/revisions"}],"predecessor-version":[{"id":5185,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts\/5184\/revisions\/5185"}],"wp:attachment":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/media?parent=5184"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/categories?post=5184"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/tags?post=5184"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}