Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

classexcerptdiv

...

Panel

In this section:

Table of Contents
maxLevel4

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.

 

Tip
titleRECOMMENDED

...

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,

...

...

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 Sonus SalesForce Customer Portal. Copy the downloaded .rpm file into /tmp directory of the Linux server. 

...

Info
titleNote

 The Screen utility is installed by default

...

with RedHat 6.x and later versions.

Code Block
languagenone
# 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:

Code Block
languagenone
# which screen

/usr/bin/screen

The Screen utility is available by default under /usr/bin/screen or /bin/screen.

Starting Linux Screen

Execute the following command to start screen:

Code Block
languagenone
# 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:

OptionsKeystokeDescription
Help

Ctrl 

...

-A + ?

...

List the screen help page

Caption
0Figure
1Screen Help

Image Modified

Creating new window

Ctrl

...

-A +

...

C

...

Create a new window with your default prompt.
Creating window titleCtrl

...

-A + A

...

Assign the screen window with a title.

Caption
0Figure
1Sample Output - Naming the Screen

Image Modified

Enter the screen window name as Scr1
Image Modified

Switching between windowsCtrl

...

-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.

Caption
0Figure
1Sample Output - Screen Detached

Image Modified

Reattach to screen

screen -r

To re-attach to your detached screen, execute this command.

If you have multiple screens you may get this:

Caption
0Figure
1Sample Output - Detached Screens

Image Modified

Enter screen -r <screen name> to re-attach the required screen.

Caption
0Figure
1Sample Output - Attached Screen

 Image Modified

Logging screen outputsCtrl

...

-A +

...

H

...

Create a running log of the session to the file "hardcopy.n" file (where n is the number of the current window).

Caption
0Figure
1Sample Output - Screen Log file

Image Modified

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 sessionCtrl

...

-A +

...

X

...

Lock your screen session. This requires a password to access the session again.

Caption
0Figure
1Sample Output - Lock Screen

Image Modified

Stopping screenexit

To exit and close the screen utility, execute this command.

Kill the screenCtrl

...

-A +

...

K

...

Terminate and exit the screen utility.

Caption
0Figure
1Sample Output - Kill Screen

Image Modified

Type y to

...

terminate the screen.

Pagebreak