Skip to content

Instantly share code, notes, and snippets.

@ravsau
Created December 27, 2018 17:03
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ravsau/0f14fe8c2ac9d9a94900863895d6fa70 to your computer and use it in GitHub Desktop.
Save ravsau/0f14fe8c2ac9d9a94900863895d6fa70 to your computer and use it in GitHub Desktop.
Simple CLI commands for Amazon S3 and GCP Cloud Storage

For the following commands to work, you need to have AWS CLI and gstuil installed. For gsutil, you can use the GCP cloud shell. For AWS CLI , you can provision an Aaazon Linux EC2 insances which comes with the S3 CLI Installed.

List buckets in AWS S3

aws s3 ls

List buckets in GCP Cloud Storage

gsutil ls

Make a new Bucket in S3

aws s3 mb s3://new-bucket-mdev

Make a new Bucket in GCP

gsutil mb gs://new-bucket-mdev

Copy local file to a bucket in AWS S3

aws s3 cp file.txt s3://new-bucket-mdev

Copy local file to a bucket in GCP Cloud Storage

gsutil cp file.txt gs://new-bucket-mdev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment