How to start a new process in a new window in an existing GNU screen session, from outside the session

好久不见. 提交于 2019-11-29 07:47:14

When you aren't in a screen session, you can pass the -X flag to screen to execute a screen command.

For example, the screen command in screen opens a new window, optionally with a command to execute.

Assuming you already have screen open somewhere:

screen -dr -X screen sleep 20

Note that the new window will close once the command (sleep in this case) finishes. If you want to keep it open you could potentially do something like this, which will type 'date\n' in the new window:

screen -dr -X screen
screen -dr -X stuff "date
"

The man pages of course have much more detail.

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