Help us understand the problem. What is going on with this article?

よく使うgcloudコマンドたち

More than 3 years have passed since last update.

一般

自分のプロジェクト一覧を表示

gcloud projects list

cloud sdkのプロパティを見る

gcloud config list

プロジェクト切り替え

gcloud config set project <your-project-id>

GCE

インスタンス一覧を見る

gcloud compute instances list

インスタンスの作成(centos-7で)

gcloud compute instances create <your-instance-name> --project <your-project-name> --image-family centos-7

使用可能なimage一覧を見る

gcloud compute images list

インスタンスの起動・停止

gcloud compute instances start <your-instance-name>
gcloud compute instances stop <your-instance-name>

インスタンスにssh

gcloud compute ssh <your-instance-name>

通常のsshコマンドで接続できるように設定

gcloud compute config-ssh
~/.ssh/configに稼働中のインスタンスへの接続設定が作られる。
ssh <your-instance-name>.<zone>.<your-project-id>
ssh [tab]で

インスタンスへローカルのファイルをコピーする

gcloud compute copy-files <local-path> <your-instance-name>:<remote-path> --zone <zone>

インスタンスにあるファイルをローカルにコピーする

gcloud compute copy-files <your-instance-name>:<remote-path> <local-path> --zone <zone>

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした