Super User is a question and answer site for computer enthusiasts and power users. 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

With GNU screen I could do, for example:

screen -S monitor top

A screen would start executing top, and if top ended the screen session would end.

Is there a way to do the same thing with tmux?

Thanks in advance.

share|improve this question
up vote 2 down vote accepted

You can start tmux and make it execute a particular command. However unlike screen, a Tmux window does not end when the command exits. I assume that in screen, the executing command and the screen window are in the same process and hence they both get killed together.

tmux new-session -s test top

-s specifies the name of the session (test in this case)

share|improve this answer
tmux exits when I quit top here, version 1.6. – Thor Sep 15 '12 at 12:15
@Thor For me tmux quits when I exit top as long as it's the only window in the session, which is perfect. Thanks guys. – Salis Sep 15 '12 at 15:16
If you are already connected to a tmux session, you can also start a new window (tmux new-window top) or a new pane (tmux split-window top). – chepner Sep 16 '12 at 1:59

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.