{"id":205,"date":"2015-09-23T23:17:06","date_gmt":"2015-09-23T15:17:06","guid":{"rendered":"https:\/\/vinta.ws\/code\/?p=205"},"modified":"2026-02-18T01:20:36","modified_gmt":"2026-02-17T17:20:36","slug":"awscli-command-line-interface-for-amazon-web-services","status":"publish","type":"post","link":"https:\/\/vinta.ws\/code\/awscli-command-line-interface-for-amazon-web-services.html","title":{"rendered":"awscli: Command-line Interface for Amazon Web Services"},"content":{"rendered":"<p><code>awscli<\/code> is the official command-line interface for all Amazon Web Services (AWS).<\/p>\n<p>ref:<br \/>\n<a href=\"https:\/\/github.com\/aws\/aws-cli\">https:\/\/github.com\/aws\/aws-cli<\/a><\/p>\n<h2>Configuration<\/h2>\n<pre class=\"line-numbers\"><code class=\"language-console\">$ pip install awscli\n\n$ aws configure<\/code><\/pre>\n<p>ref:<br \/>\n<a href=\"https:\/\/docs.aws.amazon.com\/cli\/latest\/index.html\">https:\/\/docs.aws.amazon.com\/cli\/latest\/index.html<\/a><\/p>\n<h2>S3<\/h2>\n<h3>Download A Folder<\/h3>\n<pre class=\"line-numbers\"><code class=\"language-console\">$ aws s3 sync \ns3:\/\/files.vinta.ws\/static\/images\/stickers\/ \n.<\/code><\/pre>\n<p>ref:<br \/>\n<a href=\"https:\/\/docs.aws.amazon.com\/cli\/latest\/reference\/s3\/sync.html\">https:\/\/docs.aws.amazon.com\/cli\/latest\/reference\/s3\/sync.html<\/a><br \/>\n<a href=\"https:\/\/docs.aws.amazon.com\/cli\/latest\/userguide\/cli-services-s3-commands.html#using-s3-commands-managing-objects\">https:\/\/docs.aws.amazon.com\/cli\/latest\/userguide\/cli-services-s3-commands.html#using-s3-commands-managing-objects<\/a><\/p>\n<h3>Rename A Folder<\/h3>\n<pre class=\"line-numbers\"><code class=\"language-console\">$ aws s3 cp \ns3:\/\/files.vinta.ws\/static\/images\/stickers_BACKUP\/ \ns3:\/\/files.vinta.ws\/static\/images\/stickers\/ \n--recursive<\/code><\/pre>\n<p>ref:<br \/>\n<a href=\"https:\/\/docs.aws.amazon.com\/cli\/latest\/reference\/s3\/cp.html\">https:\/\/docs.aws.amazon.com\/cli\/latest\/reference\/s3\/cp.html<\/a><\/p>\n<h3>Make A Folder Public Read<\/h3>\n<pre class=\"line-numbers\"><code class=\"language-console\">$ aws s3 sync \ns3:\/\/files.vinta.ws\/static\/ \ns3:\/\/files.vinta.ws\/static\/ \n--grants read=uri=http:\/\/acs.amazonaws.com\/groups\/global\/AllUsers<\/code><\/pre>\n<h3>Upload Files<\/h3>\n<pre class=\"line-numbers\"><code class=\"language-console\"># also make them public read\n$ aws s3 cp \n. \ns3:\/\/files.vinta.ws\/static\/images\/stickers\/ \n--recursive \n--grants read=uri=http:\/\/acs.amazonaws.com\/groups\/global\/AllUsers\n\n$ aws s3 cp \ndb.sqlite3 \ns3:\/\/files.albedo.one\/\n\n$ aws s3 sync \n.\/ \ns3:\/\/files.albedo.one\/ \n--recursive --exclude \"*\" --include \"*.pickle\"<\/code><\/pre>\n<h3>Copy Files Between S3 Buckets<\/h3>\n<pre class=\"line-numbers\"><code class=\"language-console\">$ aws s3 sync s3:\/\/your_bucket_1\/media s3:\/\/your_bucket_2\/media \n--acl \"public-read\" \n--exclude \"track_audio\/*\"<\/code><\/pre>\n<h3>Remove Files<\/h3>\n<pre class=\"line-numbers\"><code class=\"language-console\">$ aws s3 rm s3:\/\/your_bucket_1\/media\/track_audio --recursive<\/code><\/pre>\n<p>ref:<br \/>\n<a href=\"https:\/\/docs.aws.amazon.com\/cli\/latest\/reference\/s3\/rm.html\">https:\/\/docs.aws.amazon.com\/cli\/latest\/reference\/s3\/rm.html<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>awscli is a command-line interface for all Amazon Web Services (AWS).<\/p>\n","protected":false},"author":1,"featured_media":564,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[38,116],"tags":[16,17],"class_list":["post-205","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-about-devops","category-about-web-development","tag-amazon-web-services","tag-aws-s3"],"_links":{"self":[{"href":"https:\/\/vinta.ws\/code\/wp-json\/wp\/v2\/posts\/205","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vinta.ws\/code\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vinta.ws\/code\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vinta.ws\/code\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/vinta.ws\/code\/wp-json\/wp\/v2\/comments?post=205"}],"version-history":[{"count":0,"href":"https:\/\/vinta.ws\/code\/wp-json\/wp\/v2\/posts\/205\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/vinta.ws\/code\/wp-json\/wp\/v2\/media\/564"}],"wp:attachment":[{"href":"https:\/\/vinta.ws\/code\/wp-json\/wp\/v2\/media?parent=205"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vinta.ws\/code\/wp-json\/wp\/v2\/categories?post=205"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vinta.ws\/code\/wp-json\/wp\/v2\/tags?post=205"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}