How to open a command terminal in Linux?

后端 未结 8 2162
情歌与酒
情歌与酒 2020-11-30 09:45

I want to open the terminal (command prompt) on a Linux machine using Java code. I know how to open command prompt in windows.The following code i have used in windows

8条回答
  •  庸人自扰
    2020-11-30 09:53

    since you have to assume you know almost nothing about the system you are running this on, I'd say lowest common denominator would be:

    String command= "/bin/sh";

    • or even more 'guaranteed' -

    String command= "sh";

提交回复
热议问题