cd .. command does not work with gcloud compute ssh while other basic commands (such as pwd) do work. Why? [duplicate]

别说谁变了你拦得住时间么 提交于 2021-02-20 04:41:11

问题


I have a running instance my-instance running on google-cloud. I run the following code on my local machine:

gcloud compute ssh my-instance --command 'pwd'
gcloud compute ssh my-instance --command 'cd ..'
gcloud compute ssh my-instance --command 'pwd'

my output is:

/home/pal
/home/pal

My expectation is:

/home/pal
/home

It seems that cd .. is not working. Why is it? It is surprising for me especially that pwd works as shown above. How can I solve the issue?


I used this page as source: https://cloud.google.com/sdk/gcloud/reference/compute/ssh

来源:https://stackoverflow.com/questions/53638852/cd-command-does-not-work-with-gcloud-compute-ssh-while-other-basic-commands

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!