Screen
m (Robot: Adding Category:How-To) |
|||
| Line 46: | Line 46: | ||
== External link == | == External link == | ||
* http://www.guckes.net/screen/ Sven Guckes screen pages | * http://www.guckes.net/screen/ Sven Guckes screen pages | ||
| + | |||
| + | [[Category:How-To]] | ||
Revision as of 21:40, 28 November 2005
screen is a terminal multiplexer.
Once logged in on a server, use 'screen bash' and you will have another bash in a virtual window. From there you can add other windows with different program and move from a window to another. Ultimatly, you can send screen in the background & logout : screen will detach and run in the background.
Example:
hashar@bihash:$ ssh aserver $ screen bash
A new bash is invoked, my xterm title show:
[screen 0: bash] hashar@zwinger:~
This mean I am in the screen window #0 and running bash.
$ vmstat 1 procs -----------memory---------- ---swap-- -----io---- --system-- ----cpu---- r b swpd free buff cache si so bi bo in cs us sy id wa 2 0 65508 51500 106756 430740 2 1 3 4 6 6 7 14 65 14 0 0 65508 51372 106764 430732 0 0 12 24 0 0 2 15 82 2 0 0 65508 51404 106768 430728 0 0 8 0 0 0 1 10 88 1 and so on ...
I am monitoring the server. Now let's create another window to edit a file. This is done by using CTRL + A then C (for create).
A new bash is invoked, my xterm title show:
[screen 1: bash] hashar@zwinger:~
I can do whatever I want there. To move back to the window with vmstat use CTRL + A then P (for previous), to switch again CTRL + A then N (for next).
Finally it's dinner time or you need to reboot your computer, or whatever. You can send screen in the background and logout, that will keep all your program running. This is done with CTRL + A then D (for detach).
$ screen bash [detached] $ ps fx 13178 ? S 0:00 SCREEN bash 13179 pts/1235 S 0:00 \_ bash 13249 pts/1236 S 0:00 \_ /bin/bash
Screen is in the background. Now you can logout. Once logged back, you want to resume your backgrounded screen:
$ screen -r
You are back to the vmstat stuff which is still spamming values :)
Finally log out of all windows, when there is none left, screen exit:
[screen is terminating] $
External link
- http://www.guckes.net/screen/ Sven Guckes screen pages