问题
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