Back to Browse

aws s3 cli | aws cli for begineer| aws cli commands

132 views
Apr 28, 2021
30:29

Please refer below video, if you would life to configure aws cli https://youtu.be/XT7IjEzma10/ This video covered the following aws cli commands # Listing all user owned buckets aws s3 mb s3://demo-xyz --region us-east-1 aws s3 mb s3://demo-efg --region us-east-1 # List bucket $ aws s3 ls # insert/copy a local files to S3 $ aws s3 cp about.html s3://demo-xyz/about.html # listed down the object in the bucket aws s3 ls s3://demo-xyz # Copying a file from S3 bucket to other S3 aws s3 cp s3://demo-xyz/about.html s3://demo-efg/about.html # Recursively copying local files to S3 and exclude $ cd html aws s3 cp html s3://demo-xyz/html --recursive --exclude "*.png" # download s3 object to local # mkdir local && cd local $ aws s3 cp s3://demo-xyz/about.html about.html # Recursively copying S3 objects to a local directory aws s3 cp s3://demo-xyz . --recursive # Listing all prefixes and objects in a bucket $ aws s3 ls s3://demo-xyz # lising all the objects recusively in a bucket that includes prefix aws s3 ls s3://demo-xyz --recursive # Listing all prefixes and objects in a specific bucket and prefix $ aws s3 ls s3://demo-xyz/html/ # mv command moves a single file to a specified bucket and key: aws s3 mv source destination aws s3 mv about.html s3://demo-xyz/about.html # remove empty bucket, if not, you may see below error λ aws s3 rb s3://demo-xyz output: remove_bucket failed: s3://demo-xyz An error occurred (BucketNotEmpty) when calling the DeleteBucket operation: The bucket you tried to delete is not empty # remove an object in s3 bucket aws s3 rm s3://demo-xyz/about.html aws s3 rm s3://demo-xyz/ --recursive --exclude "*.png" aws s3 rm s3://demo-xyz --recursive # remove objets and bucket aws s3 rb s3://mybucket --force # Syncs directories and S3 prefixes. Recursively copies new and updated files from the source directory to the destination. Only creates folders in the destination if they contain one or more files. aws s3 sync . s3://demo-efg # sync from one bucket to other aws s3 sync s3://demo-efg s3://demo-xyz # sync to local directory aws s3 sync s3://demo-efg . # remove file from s3 buckets recursive aws s3 rm s3://demo-efg --recursive --exclude "" # sync with delete options $ aws s3 sync . s3://demo-efg --delete

Download

0 formats

No download links available.

aws s3 cli | aws cli for begineer| aws cli commands | NatokHD