www.mamboteam.com
macsat.com - OpenWrt | Olegs Firmware  
Home arrow Tutorials - OpenWrt (White Russian) arrow GNU Screen
Friday, 09 January 2009
 
 
Main Menu
Home
About
News
Tutorials - OpenWrt (WR)
Tutorials - Oleg
Wiki (RDC Based Routers)
Online Shop
Forum
Downloads
Free Linux eBooks
Links
Search
Contact Us
We have 5 guests online
2944945 Visitors
Login
Welcome Guest.






Lost Password?
No account yet? Register
Old macsat.com
Nokia Unlock (Dansk)
Nokia Unlock (English)
XBins IRC Chat
GNU Screen PDF Print E-mail
(3 votes)
Written by macsat   
Tuesday, 17 January 2006

GNU Screen is according the the official homepage:
"Screen is a full-screen window manager that multiplexes a physical terminal between several processes, typically interactive shells. "

In a more plain English, GNU Screen let you run multiple shell processes in parallel, run processes in the background and still having full control with all of the running processes.

A typical application of GNU Screen would be to run tools like netstat, running large (multiple hour) donwloads using wget, ftp or bittorrent and so on. 

 

Index

1) Installing
2) General Usage
3) Usage Example

Installing GNU Screen

Installing GNU Screen is pretty straight forward:
ipkg install screen

This will install both GNU screen and the  ncurses libraries (libncurses).

Since libs are installed, if you are installing to /opt as described in my installing to /opt tutorial, you will need to run my script called optlibs.sh and in this special case, even make a symlink yourselves:
optlibs.sh
ln -s /opt/usr/share/terminfo/ /usr/share/terminfo

Now you should be able to run GNU screen, by issuing the command:
screen

 You will now see a welcome screen containing stuff like "Screen version 4.00.02 (FAU) 5-Dec-03"
To skip this welcome screen press <space> or <enter>

General Usage Information

 GNU Screen opens a "virtual" shell window (window 0) with the possibility of opening multiple windows in the background (window1, window2....), splitting the screen to show the output of multiple windows and even to put the entire screen process (and hence all the windows) in the background, with the possibility to bring it back on the screen whenever you need (even after having been logged off the system and logging on again!).

There is a bunch of commandline commands for screen, you can see a list of thoose by writing:
screen --help

 Besides the commandline commands, there is also a large range of "online" commands, issued with a sequence of keys when you are in one of the virtual screen terminal sessions.

Theese commands include:
Creating a new virtual window (starting with window1 then window2 and so on):  <ctrl>-<a> +  <c>
Going to next / previous window: <ctrl>-<a> + <n> / <ctrl>-<a> + <p>
Going to window "N": <ctrl>-<a> + <N>    where N is [0:9]
Bring up list of windows: <ctrl>-<a> + <">
"Detatch" screen and return to the normal bash shell (screen and all processes in it, will keep running in the background): <ctrl>-<a> + <d>


For a complete list of commands, check out the GNU Screen man page

Usage Example

 If you follow theese steps, you will see the point in screen. We will load screen, start a programme, create new window, start one more programme, switching beteween the two programmes, send screen to the background (detatch), log off from the router, log back on, reconnect to screen and the running processes and finally close down screen.

1) run screen by: screen
2) start top: top
3) create a new window: <ctrl>-<a> + <c>
4) start vi: vi
5) switch to next window (will be window0, since we have only two windows): <ctrl>-<a> + <n>
6) detatch screen: <ctrl>-<a> + <d>
7) log off the routeR: exit
8) log back on your router
9) access your screen windows again: screen -r
10) close down top with : <q>
11) close window0 of screen: exit
12) exit vi: <esc> + <:> + q! <enter>
13) exit screen: exit

I hope the above gives you an idea of GNU screens powers, I use it a lot when downloading large ISO files and so on, from ftp, www or bittorrent.

 

Last Updated ( Tuesday, 17 January 2006 )
 
< Prev   Next >
Buy Router
Linksys WRT54GL
Linksys WRT54GL
Recent Forum Topics
Donations

If you appriciate this site, please consider making a small donation.

All donations will be used to cover expenses from running macsat.com.

Sponsored Ads
 
Top! Top!