Page tree
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Screen

RECOMMENDED

Sonus recommends Screen usage when you work 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 sessions from multiple locations.
  • Run a long running 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 want to do using screen. 

For more information on the Screen Utility, see 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 Sonus SalesForce Customer Portal. Copy the downloaded .rpm file into /tmp directory of the Linux server. 

The Screen utility is installed by default in RedHat 6.x and later.

# 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

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

Starting Linux Screen

Execute the following command to start screen:

# screen

Screen Options

The Screen uses the Ctrl + a command to send commands to screen instead of the shell. The following command are used in combination with the Ctrl + a command:

OptionsKeystokeDescription
Help

Ctrl + a   ?

To lists the screen help page

Figure : Screen Help

Creating new window

Ctrl+ a   c

To creates a new window with your default prompt.
Creating window titleCtrl+ a A

To assign the screen window with a title.

Figure : Sample Output - Naming the Screen

Enter the screen window name as Scr1

Switching between windowsCtrl+ a   nTo switch to the next window.
Ctrl+ a   p

To switch to the previous window.

Ctrl+a <1-9>

To switch to screen window number 0 to 9.

Example: Crtl +a 2, switches to the second screen window.

Detaching from screenCtrl+ a   d

To detach from a window and reattach later.

Figure : Sample Output - Screen Detached

Reattach to screen

screen-r

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

If you have multiple screens you may get this:

Figure : Sample Output - Detached Screens

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

Figure : Sample Output - Attached Screen

 
Logging screen outputsCtrl+ a   h

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

Figure : Sample Output - Screen Log file

The hardcopys are dumped in screen's current working directory.

Getting alerts
 
Ctrl+ a   m

To monitoring 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. Screen 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

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

Figure : Sample Output - Lock Screen

Stopping screenexit

To exit and close screen utility, execute this command.

Kill the screenCtrl+ a   k

To kill and exit the screen utility.

Figure : Sample Output - Kill Screen

Type y to kill the screen.

  • No labels