Multiple commands on remote machine using shell script

后端 未结 3 673
遇见更好的自我
遇见更好的自我 2020-12-01 12:30

I have a Java program Desktop/testfolder/xyz.jar on a remote machine. It has a configuration file on the same folder. When I SSH into the machine, I do:

3条回答
  •  南笙
    南笙 (楼主)
    2020-12-01 12:49

    You could try separating the commands by a semicolon:

    ssh user@remote "cd Desktop/testfolder ; java -cp xyz.jar Main"
    

提交回复
热议问题