Last active
February 21, 2025 08:34
-
-
Save supriya-premkumar/c233a34096adfdd8372b46d790b3136d to your computer and use it in GitHub Desktop.
Revisions
-
Supriya Premkumar revised this gist
Mar 7, 2017 . 1 changed file with 11 additions and 11 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -5,55 +5,55 @@ https://gist.github.com/supriya-premkumar/f51b4c61ac984c93934381dfa3d78454 **1. Create S3 Bucket:** ```aws s3 mb s3://your-bucket-name``` **_2. Delete S3 Bucket:_** ```aws s3 rb s3://your-bucket-name``` **3. Delete S3 bucket if it has content(Object/s) in S3 bucket:** ```aws s3 rb s3://your-bucket-name —force``` **4. List S3 bucket/s:** ```aws s3 ls``` **5. Copy file from Local Machine to AWS S3:** ```aws s3 cp test.txt s3://your-bucket-name``` **6. Test if the copied file exists in the bucket:** ```aws s3 ls s3://your-bucket-name``` **7. To Sync all the folders/files from local machine to the s3 bucket:** ```aws s3 sync . s3://your-bucket-name/create-new-folder``` **8. To list all the keys in S3:** ```aws s3 ls s3://your-bucket-name —recursive``` **9. Since there is not cat command to read the file, we can use the following command to read a file** ```aws s3 cp s3://your-bucket-name/README - ``` **10. To check the content size in the s3 bucket** ```aws s3 ls s3://your-bucket-name/folder-name --recursive | awk 'BEGIN {total=0}{total+=$3}END{print total/1024/1024" MB"}' ``` **11. To delete contents in the bucket** ```aws s3 rm s3://your-bucket-name --recursive ``` -
Supriya Premkumar revised this gist
Mar 7, 2017 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -54,4 +54,6 @@ https://gist.github.com/supriya-premkumar/f51b4c61ac984c93934381dfa3d78454 ```aws s3 ls s3://your-bucket-name/folder-name --recursive | awk 'BEGIN {total=0}{total+=$3}END{print total/1024/1024" MB"}' ``` **To delete contents in the bucket** ```aws s3 rm s3://your-bucket-name --recursive ``` -
Supriya Premkumar revised this gist
Mar 7, 2017 . 1 changed file with 24 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,35 +1,57 @@ #Access S3 from AWS CLI ##Pre-Requisite : Install AWS CLI and Configure AWS https://gist.github.com/supriya-premkumar/f51b4c61ac984c93934381dfa3d78454 **Create S3 Bucket:** ```aws s3 mb s3://your-bucket-name``` **_Delete S3 Bucket:_** ```aws s3 rb s3://your-bucket-name``` **Delete S3 bucket if it has content(Object/s) in S3 bucket:** ```aws s3 rb s3://your-bucket-name —force``` **List S3 bucket/s:** ```aws s3 ls``` **Copy file from Local Machine to AWS S3:** ```aws s3 cp test.txt s3://your-bucket-name``` **Test if the copied file exists in the bucket:** ```aws s3 ls s3://your-bucket-name``` **To Sync all the folders/files from local machine to the s3 bucket:** ```aws s3 sync . s3://your-bucket-name/create-new-folder``` **To list all the keys in S3:** ```aws s3 ls s3://your-bucket-name —recursive``` **Since there is not cat command to read the file, we can use the following command to read a file** ```aws s3 cp s3://your-bucket-name/README - ``` **To check the content size in the s3 bucket** ```aws s3 ls s3://your-bucket-name/folder-name --recursive | awk 'BEGIN {total=0}{total+=$3}END{print total/1024/1024" MB"}' ``` -
Supriya Premkumar revised this gist
Mar 7, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ ##Access S3 from AWS CLI #Pre-Requisite : Install AWS CLI and Configure AWS https://gist.github.com/supriya-premkumar/f51b4c61ac984c93934381dfa3d78454 -
Supriya Premkumar renamed this gist
Mar 7, 2017 . 1 changed file with 10 additions and 10 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -4,32 +4,32 @@ https://gist.github.com/supriya-premkumar/f51b4c61ac984c93934381dfa3d78454 **Create S3 Bucket:** ```aws s3 mb s3://your-bucket-name``` **_Delete S3 Bucket:_** ```aws s3 rb s3://your-bucket-name``` **Delete S3 bucket if it has content(Object/s) in S3 bucket:** ```aws s3 rb s3://your-bucket-name —force``` **List S3 bucket/s:** ```aws s3 ls``` **Copy file from Local Machine to AWS S3:** ```aws s3 cp test.txt s3://your-bucket-name``` **Test if the copied file exists in the bucket:** ```aws s3 ls s3://your-bucket-name``` **To Sync all the folders/files from local machine to the s3 bucket:** ```aws s3 sync . s3://your-bucket-name/create-new-folder``` **To list all the keys in S3:** ```aws s3 ls s3://your-bucket-name —recursive``` **Since there is not cat command to read the file, we can use the following command to read a file** ```aws s3 cp s3://your-bucket-name/README - ``` **To check the content size in the s3 bucket** ```aws s3 ls s3://your-bucket-name/folder-name --recursive | awk 'BEGIN {total=0}{total+=$3}END{print total/1024/1024" MB"}' ``` -
Supriya Premkumar revised this gist
Mar 7, 2017 . 1 changed file with 12 additions and 10 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,33 +1,35 @@ #Access S3 from AWS CLI #Pre-Requisite : Install AWS CLI and Configure AWS https://gist.github.com/supriya-premkumar/f51b4c61ac984c93934381dfa3d78454 **Create S3 Bucket:** aws s3 mb s3://your-bucket-name **_Delete S3 Bucket:_** aws s3 rb s3://your-bucket-name **Delete S3 bucket if it has content(Object/s) in S3 bucket:** aws s3 rb s3://your-bucket-name —force **List S3 bucket/s:** aws s3 ls **Copy file from Local Machine to AWS S3:** aws s3 cp test.txt s3://your-bucket-name **Test if the copied file exists in the bucket:** aws s3 ls s3://your-bucket-name **To Sync all the folders/files from local machine to the s3 bucket:** aws s3 sync . s3://your-bucket-name/create-new-folder **To list all the keys in S3:** aws s3 ls s3://your-bucket-name —recursive **Since there is not cat command to read the file, we can use the following command to read a file** aws s3 cp s3://your-bucket-name/README - **To check the content size in the s3 bucket** aws s3 ls s3://your-bucket-name/folder-name --recursive | awk 'BEGIN {total=0}{total+=$3}END{print total/1024/1024" MB"}' -
Supriya Premkumar revised this gist
Mar 7, 2017 . 1 changed file with 10 additions and 10 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,33 +1,33 @@ #Access S3 from AWS CLI #Pre-Requisite : Install AWS CLI and Configure AWS ```https://gist.github.com/supriya-premkumar/f51b4c61ac984c93934381dfa3d78454``` **Create S3 Bucket:** ```aws s3 mb s3://your-bucket-name``` **_Delete S3 Bucket:_** ```aws s3 rb s3://your-bucket-name``` **Delete S3 bucket if it has content(Object/s) in S3 bucket:** ```aws s3 rb s3://your-bucket-name —force``` **List S3 bucket/s:** ```aws s3 ls``` **Copy file from Local Machine to AWS S3:** ```aws s3 cp test.txt s3://your-bucket-name``` **Test if the copied file exists in the bucket:** ```aws s3 ls s3://your-bucket-name``` **To Sync all the folders/files from local machine to the s3 bucket:** ```aws s3 sync . s3://your-bucket-name/create-new-folder``` **To list all the keys in S3:** ```aws s3 ls s3://your-bucket-name —recursive``` **Since there is not cat command to read the file, we can use the following command to read a file** ```aws s3 cp s3://your-bucket-name/README - ``` -
Supriya Premkumar revised this gist
Mar 7, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -6,7 +6,7 @@ https://gist.github.com/supriya-premkumar/f51b4c61ac984c93934381dfa3d78454 ``` **Create S3 Bucket:** `aws s3 mb s3://your-bucket-name` **_Delete S3 Bucket:_** -
Supriya Premkumar revised this gist
Mar 6, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -9,7 +9,7 @@ https://gist.github.com/supriya-premkumar/f51b4c61ac984c93934381dfa3d78454 __Create S3 Bucket:__ `aws s3 mb s3://your-bucket-name` **_Delete S3 Bucket:_** ```aws s3 rb s3://your-bucket-name``` **Delete S3 bucket if it has content(Object/s) in S3 bucket:** -
Supriya Premkumar revised this gist
Mar 6, 2017 . 1 changed file with 0 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,5 @@ #Access S3 from AWS CLI #Pre-Requisite : Install AWS CLI and Configure AWS ``` https://gist.github.com/supriya-premkumar/f51b4c61ac984c93934381dfa3d78454 -
Supriya Premkumar revised this gist
Mar 6, 2017 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,7 @@ #Access S3 from AWS CLI #Install AWS CLI on MAC #Pre-Requisite : Install AWS CLI and Configure AWS ``` https://gist.github.com/supriya-premkumar/f51b4c61ac984c93934381dfa3d78454 -
Supriya Premkumar revised this gist
Mar 6, 2017 . 1 changed file with 5 additions and 3 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,9 @@ #Access S3 from AWS CLI #Pre-Requisite : Install AWS CLI and Configure AWS ``` https://gist.github.com/supriya-premkumar/f51b4c61ac984c93934381dfa3d78454 ``` __Create S3 Bucket:__ -
Supriya Premkumar revised this gist
Mar 6, 2017 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,11 +1,11 @@ # Access S3 from AWS CLI ## Pre-Requisite : Install AWS CLI and Configure AWS ``` https://gist.github.com/supriya-premkumar/f51b4c61ac984c93934381dfa3d78454 ``` __Create S3 Bucket:__ `aws s3 mb s3://your-bucket-name` **Delete S3 Bucket:** ```aws s3 rb s3://your-bucket-name``` -
Supriya Premkumar revised this gist
Mar 6, 2017 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ #Access S3 from AWS CLI ##Pre-Requisite : Install AWS CLI and Configure AWS ``` https://gist.github.com/supriya-premkumar/f51b4c61ac984c93934381dfa3d78454 ``` -
Supriya Premkumar revised this gist
Mar 6, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -4,7 +4,7 @@ ``` https://gist.github.com/supriya-premkumar/f51b4c61ac984c93934381dfa3d78454 ``` __Create S3 Bucket:__ ```aws s3 mb s3://your-bucket-name``` **Delete S3 Bucket:** -
Supriya Premkumar revised this gist
Mar 6, 2017 . 1 changed file with 10 additions and 10 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,31 +1,31 @@ # Access S3 from AWS CLI ## Pre-Requisite : Install AWS CLI and Configure AWS ``` https://gist.github.com/supriya-premkumar/f51b4c61ac984c93934381dfa3d78454 ``` **Create S3 Bucket:** ```aws s3 mb s3://your-bucket-name``` **Delete S3 Bucket:** ```aws s3 rb s3://your-bucket-name``` **Delete S3 bucket if it has content(Object/s) in S3 bucket:** ```aws s3 rb s3://test-bucket —force``` **List S3 bucket/s:** ```aws s3 ls``` **Copy file from Local Machine to AWS S3:** ```aws s3 cp test.txt s3://test-bucket``` **Test if the copied file exists in the bucket:** ```aws s3 ls s3://test-bucket``` **To Sync all the folders/files from local machine to the s3 bucket:** ```aws s3 sync . s3://test-bucket/create-new-folder``` **To list all the keys in S3:** ```aws s3 ls s3://test-bucket —recursive``` -
Supriya Premkumar created this gist
Mar 6, 2017 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,31 @@ #Access S3 from AWS CLI ##Pre-Requisite : Install AWS CLI and Configure AWS ``` https://gist.github.com/supriya-premkumar/f51b4c61ac984c93934381dfa3d78454 ``` Create S3 Bucket: ```aws s3 mb s3://your-bucket-name``` Delete S3 Bucket: ```aws s3 rb s3://your-bucket-name``` Delete S3 bucket if it has content(Object/s) in S3 bucket: ```aws s3 rb s3://test-bucket —force``` List S3 bucket/s: ```aws s3 ls``` Copy file from Local Machine to AWS S3: ```aws s3 cp test.txt s3://test-bucket``` Test if the copied file exists in the bucket: ```aws s3 ls s3://test-bucket``` To Sync all the folders/files from local machine to the s3 bucket: ```aws s3 sync . s3://test-bucket/create-new-folder``` To list all the keys in S3 ```aws s3 ls s3://test-bucket —recursive```