In this section:
Overview
The Screen utility is a tool for use with Linux that connects a physical terminal between several shell processes. This utility is included with all Linux-based Ribbon products.
Ribbon recommends using the Screen utility when working remotely on a server, especially during install, upgrade or migration activities.
The Screen utility allows you to:
- Use multiple shell windows from a single SSH session.
- Keep a shell active during network disruptions.
- Disconnect and re-connect to a shell session from multiple locations.
- Run a lengthy process without maintaining an active shell session.
- Copy-and-Paste text between windows and so on.
All windows run their programs completely independent of each other. Whatever you type is sent to the program running in the current window. To initiate the command, use Ctrl-A. This is usually followed by another keystroke depending on what you do next.
For more information on the Screen utility, refer to http://www.gnu.org/software/screen/manual/screen.html.
Installing the Screen
Download the screen-4.0.3-4.el5.x86_64.rpm
file (only in case of RedHat 5.x releases) from the LINTEL_PLATFORM area of Ribbon Support Portal. Copy the downloaded .rpm
file into /tmp
directory of the Linux server.
The Screen utility is installed by default with RedHat 6.x and later versions.
# cd /tmp # rpm -ihv screen-4.0.3-4.el5.x86_64.rpm
To check if Screen is installed in your Linux system, execute the following command:
# which screen /usr/bin/screen
To check the screen version , execute the following command.
#screen --version Screen version 4.01.00devel (GNU) 2-May-06
The Screen utility is available by default under /usr/bin/screen
or /bin/screen
.
Starting Linux Screen
Execute the following command to start screen:
# screen
Screen Options
The Screen utility uses the Ctrl-A command to send commands to screen instead of the shell.
The following commands are used in combination with the Ctrl-A command:
Options | Keystoke | Description |
---|---|---|
Help | Ctrl -A + ? | List the screen help page Screen Help |
Creating new window | Ctrl-A + C | Create a new window with your default prompt. |
Creating window title | Ctrl-A + A | Assign the screen window with a title. Sample Output - Naming the Screen Enter the screen window name as Scr1 |
Switching between windows | Ctrl-A + N | Switch to the next window. |
Ctrl-A + P | Switch to the previous window. | |
Ctrl-A + <1-9> | Switch to screen window number 0 to 9. Example: Ctrl-A + 2, switches to the second screen window. | |
Detaching from screen | Ctrl-A + D | Detach from a window and reattach later. Sample Output - Screen Detached |
Reattach to screen |
| To re-attach to your detached screen, execute this command. If you have multiple screens you may get this: Sample Output - Detached Screens Enter Sample Output - Attached Screen |
Logging screen outputs | Ctrl-A + H | Create a running log of the session to the file "hardcopy.n" file (where n is the number of the current window). Sample Output - Screen Log file The hard copies are dumped in the screen's current working directory. |
Getting alerts | Ctrl-A + M | Monitor a window for activity. Example: If you are waiting for output from a long-running program, you can use Ctrl + a M to look for activity. The Screen utility will then flash an alert at the bottom of the page when output is registered on that screen. If you are downloading a large file or compiling a program, you can be notified when there is no more output. |
Locking screen session | Ctrl-A + X | Lock your screen session. This requires a password to access the session again. Sample Output - Lock Screen |
Stopping screen | exit | To exit and close the screen utility, execute this command. |
Kill the screen | Ctrl-A + K | Terminate and exit the screen utility. Sample Output - Kill Screen Type |