With the screen command, the -X option allows you to execute a command in the specified screen session, but when you try to use it when creating a new screen, e.g:

screen -dmS -S downloader -X "wget https://google.com"

you get the error No screen session found.. So it's clear the the -X option only works for pre-existing screen sessions.

Is it possible to specify a command to be run on the creation of a new screen? If it's not possible in screen, is it possible in another multiplexer like tmux?

1 Answer 1


I found my answer, although it was under a different title and the question was slightly different, this does the job:

screen -d -S downloader -m wget https://google.com

It creates a new screen called downloader, detaches it and runs the command.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .