Screen

From Linux 101, The beginner's guide to all things Linux.

Jump to: navigation, search

Contents

[edit] What is Screen?

Screen is a program used to suspend/resume terminal sessions between logins. Starting screen invokes a resident daemon that manages your screen sessions. Yes, that's not a typo, you have multiple sessions in the same terminal window; think about it like tabbed browsing. Possible uses are keeping a termial based IRC client (irssi) resident between sessions, debuging a system, accessing mail with a terminal MUA. Screen can also be used as a teaching tool. If someone asks for computer help, get them to let you ssh in, start a screen session, and then have them connect to the same session. They will now be able to see everything you type. Voila, instant chat client and simultaneous terminal session.

[edit] Using Screen

If no screen session is resident, type

screen

or

screen <program name> [arguments]

from within a running session.

If a screen session is already in progress, you may type

screen -r

or

screen -x

to attach to the session. The difference is if someone is already connected to the screen, the -r process will disconnect them and then connect you. The -x option will allow you both to share. This is a really cool way to program together with someone, because you both can see and edit the files.

When you're done with the current session, but you still wish to keep your "screens" open, type

CTRL-a d
(that is, hit CTRL-a then hit d).

[edit] Most Commonly Used Commands

CTRL-a d detach from the running session
CTRL-a c create a new window in the session
CTRL-a p switch to the previous window
CTRL-a n switch to the next window
CTRL-a x switch to window x, windows start at 0

[edit] External Links

Screen info page

Personal tools