How to create a screen executing given command?

前端 未结 7 1585
星月不相逢
星月不相逢 2020-12-07 18:07

i\'m fairly new in *nix. Is there a way to create a screen, which will immediately execute a given command sequence (with their own arguments)? Two hours of googling yields

7条回答
  •  -上瘾入骨i
    2020-12-07 18:31

    screen -dmS screen_name bash -c 'sleep 100'

    This will create new screen named screen_name. And inside the screen it will sleep for 100 seconds.

    Note that if you type some command in place of sleep 100 which terminates immediately upon execution, the screen will terminate as well. So you wont be able to see the screen you just created

提交回复
热议问题