GNU Screen - create screen in background run command from shell or script

Viewed 22680

I am trying to create a screen session/window from the shell and launch a command in it. How would I do that?

2 Answers

first create new session :

screen -dmS [session_name]

then attach command or script to run in session created :

screen -x [session_name] [script.sh]

Related