Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a little problem with screen.

I wanted to launch several servers in a screen session, so I made a little script designed to to have one server per window.

screen -dmS servers
screen -S servers -t http -p 0 sh -c "cd /servers/start/httpo ;"
screen -S servers -t sql -p 1 sh -c "cd /servers/start/sql ;"

But it's not working right - the sessions are created, but all the commands start on the first window.

I read the man page, but I still can't find what I did wrong.

share|improve this question
up vote 0 down vote accepted

Try this:


screen -dmS servers -T xterm -t "http" sh -c 'cd /servers/start/httpo;'

screen -T xterm -S "servers" -X screen screen -t "sql" sh -c 'cd /servers/start/sql;'

The "-T xterm" switch isn't really necessary, unless you plan to use curses-based programs from inside the screen (mc, less, etc.).

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.