Search code examples
linuxgnu-screen

how to launch screen and then execute a command inside this screen?


When I type in:

screen -S game;ls;

However the 'ls' command is executed outside the screen.

How can I start the 'game' screen and execute the ls command inside the screen ?


Solution

  • screen [ -options ] [ cmd [ args ] ]
    

    example: screen -S game ls