Screen






Intro


Screen is a full screen window manager, which divide a terminal between several processes. Using screen you can handle a task from on a PC, by detaching the terminal to which it is bound and resume it on another terminal or PC.

Screen read all typed commands through the shell from which it was launched. In order to interact directly with its window manager, it must automatically be launched using the sequence of keys "CTRL-a" followed by a key or another key sequence.

Opening a screen session


To open a screen session from a terminal (or Xterm) type the following command:

screen -r

Seperating a screen session


To detach a screen session and return to his connection shell, simply type:
CTRL-a  d

Return to a screen session


To return to a screen session, type:

screen –r

Closing a screen session


To close a screen session, simply type:
CTRL-a  


Note that :"" (backslash) is obtained using the following combination of keys "Alt Gr +8".

Seperating a window into several parts


The separation of your terminal into two parts is done in three phases. Note that you can repeat the procedure, split screen in more than two parts.

Splitting the terminal


CTRL-a  MAJ-s

Switch to the new window


CTRL-a  TAB

Open a new terminal


CTRL-a  c

Managing the different windows


Select a particular window


If several active windows:

CTRL-a   "

or
CTRL-a   n

or

CTRL-a   '

Resizing a window


To modify the size of a window, just:

To extend it:
CTRL-a :resize + n


To decrease the size:
CTRL-a :resize – n


Adjust all windows to the same size:
CTRL-a :resize =

Renaming a window


To rename a window, simply type:

CTRL-a  MAJ-a


Enter the new name for the window, and then validate using the Enter key.

Making use of screen


Connecting via ssh on machine B
Launch screen
screen


Launching a command for an active task
Hold task (suspending it)

CTRL + Z

Set to background

bg% 1


Protection of the task using nohup
nohup top & 


Seperating the screen

CTRL + a => d


Disconnect

exit


Launching screen on the machine B from a shell
Recovering the screen

screen-r


Verifying the task

jobs


Setting task as priority
fg %1

See also

Published by netty5 - Last update on January 26, 2010 10:38 AM by jak58
  1 2 3 4 5 6 7  

User's advices

Add comment
Add comment
See also