Penguin
Note: You are viewing an old revision of this page. View the current version.

Screen is an unusual and highly useful TerminalEmulator. It allows you to run interactive console programs in a Screen session that persists even if you close the terminal window or SSH session you started it in. In fact, you can later reattach to the Screen session. The programs running inside are never affected in the least.

You might f.ex start a MailClient or an IRC client inside a Screen session on a server. You can use SSH to connect to that server from anywhere and and take control of the session, never having to close the programs running inside that session. This is particularly useful if you only have physical access to a machine with a flaky connection (such as dial-up or dynamically-assigned IP) but have an account on well-connected machine. By running clients in a Screen session on that server you can avoid them dying every time you lose your connection.

You might also be interested in Xnest(1) combined with xmove(1)?, which does a similar thing for GUI apps -- xnest provides an XServer inside another XServer, and xmove can change the display of running X11 applications - ie redirect them to another X server.


Useful tips

  • See the screen(1) man-page.
  • screen -rx allows to to attach to an existing screen session, even if you are already attached to it from another terminal.
  • If you use Ctrl-A a lot and don't like screen catching this, you can change the key used for this by adding escape ^ss or similar to /.screenrc. The first character, ^s defines the escape char, the second character is what you press after an escape to send a literal escape sequence.