An Introduction to Screen


What is screen?

(4:01 PM) sharmahd: /me is amazed at how many people don't know about screen
(4:04 PM) hulet: I don't know about screen   
I've looked at the man page, but didn't really grok it. It looks like a fancy nohup?
(4:04 PM) sharmahd: how do you survive?
(4:04 PM) hulet: What problem does screen solve?
(4:05 PM) sharmahd: well, hmmm... how do i explain it
(4:05 PM) hulet: exactly

GNU Screen is a free terminal multiplexer developed by the GNU Project. It allows a user to access multiple separate terminal sessions inside a single terminal window or remote terminal session. It is useful for dealing with multiple programs from the command line, and for separating programs from the shell that started the program.1

As I’m learning screen here’s what I’ve found useful to know:

Starting screen:

screen to start
screen -r to reattach

screen -ls to list the currently active screen sessions and their <pid>.<tty>.<host> session names
screen -r <session name> to reattach to a specific session where session name has the format <pid>.<tty>.<host>

Within screen:

C-a c create window
C-a n and C-a p to switch to the next or previous window in the list, by number.
C-a N where N is a number from 0 to 9, to switch to the corresponding window.
C-a C-a switch to the most recently visited window
C-a “ to get a full-screen list of windows.
C-a A to name a window

C-a d detach from session (or just close the terminal window)

C-a [ or C-a <esc> enter copy mode (necessary for scrolling); enter or space delimits selections
C-a ] paste
C-a H toggle logging

C-a s Send a control-s to the current window, which usually has the result of suspending (freezing) the terminal; use C-a q to resume normal operation
C-a S Split the current region into two new ones; use C-a Q to close all regions but the currently active one

C-a ? to get help

I also made a .screenrc file.

No Comments

No comments yet.

Comments RSS

Sorry, the comment form is closed at this time.


powered by WordPress     themed by Mukkamu     presented by ideaharbor.org     everything else by steve hulet