The first use of screen for open source software

Source: Internet
Author: User

I saw an article about linux screen collaboration on the Internet. The original Article is as follows:

Screen collaboration
David, a senior maintenance user from the product project, called and said, "Why cannot I compile supercode. c on the new machines you deploy ".
You will ask him: "What machine are you running ?"
David replied: "Posh ". (This virtual enough company named its five production servers in the way Spice Girls was used ). Now you can show your skills. Another machine is operated by David:
# Su-david
To posh:
# Ssh posh
Run the following code:
# Screen-S foo
Then call David:
"David, run the command # screen-x foo on the terminal ".
This allows you and David to link sessions in Linux shell. You can enter, but you can see what the other party is doing. This avoids other layers, and both parties have the same control. The advantage of doing so is that David can observe your fault diagnosis skills and understand how to solve the problem accurately.
Finally, we can see the problem: David's compilation script hardcoded an old directory not on this new server. Load it and compile it again to solve the problem, and then David continues to work. You can continue your previous entertainment activities.
Note that both parties must log on to the same user. The screen command can also implement multiple windows and split screens. Read the manual page for more information.
I have the last tip for screen sessions. To separate and enable it, enter Ctrl-a d (that is, press Ctrl and click. Then press D ).
Then, you can re-splice the screen-x foo command.

I felt quite interesting, so I searched the internet for screen. Below is:
Download Directory: ftp://ftp.gnu.org/gnu/screen/screen-4.2.1.tar.gz
Other: ftp://ftp.gnu.org/gnu/screen/


After the download is complete, ftp to the temporary directory of linux, decompress the package, and enter the directory,
Install the trilogy as follows:

[Billing_dx @ bmcs1 screen-4.2.1] $./configure -- prefix = "/account/work/ymm/usr/local" # specify the installation directory this is screen version 4.2.1 ...... Now please check the pathnames in the Makefile and in the userconfiguration section in config. h. then type 'make' to make screen. good luck. [billing_dx @ bmcs1 screen-4.2.1] $ make # compile CPP = "gcc-E-DETCSCREENRC = '"/account/work/ymm/usr/local/etc/screenrc "'- DSCREENENCODINGS = '"/account/work/ymm/usr/local/share/screen/utf8encodings"' "srcdir =. sh. /osdef. shAWK = gawk CC = "gcc-g-O2-D_GNU_SOURCE" srcdir =. sh ./Comm. shAWK = gawk srcdir =. sh./term. sh ...... Gcc-o screen. o ansi. o fileio. o mark. o misc. o resize. o socket. o search. o tty. o term. o window. o utmp. o loadav. o putenv. o help. o termcap. o input. o attacher. o pty. o process. o display. o comm. o kmapdef. o acls. o braille. o braille_tsi.o logfile. o layer. o list_generic.o list_display.o list_1_1_o sched. o teln. o nethack. o encoding. o canvas. o layout. o viewport. o-lcurses-lelf-lcrypt [billing_dx @ bmc S1 screen-4.2.1] $ make install # installation. /etc/mkinstalldirs/account/work/ymm/usr/local/bin/account/work/ymm/usr/local/share/screen/utf8encodings ...... Termcap entry (. /terminfo/screencap) shocould be installed manually. you may also want to install. /etc/etcscreenrc in/account/work/ymm/usr/local/etc/screenrc [billing_dx @ bmcs1 screen-4.2.1] $ ls/account/work/ymm/usr/local/ bin/# view the generated file screen-4.2.1 Installation prompt, the operation is as follows: 1. Use billing_dx to log on to a terminal and execute screen-S ymm. 2. Use billing_dx to log on to a terminal, execute screen-x ymm to connect the two windows. All operations are synchronized. I searched the internet for the meanings of the two parameters in the screen command:
-S sessionnameWhen creating a new session, this option can be used to specify a meaningful name for the session. this name identifies the session for "screen-list" and "screen-r" actions. it substitutes the default [tty. host] suffix. #-S creates a new session-xAttach to a not detached screen session. (Multi display mode ). # When Using-x to connect to a specified session to search for these items online, it is easier to use google. If you only use English, the effect may be better. For example, google searches for linux screen man. I originally wanted to view the usage of screen, but because I couldn't find the manual file, so:
[Billing_dx @ bmcs1 screen-4.2.1] $ man screenCannot open the message cats1 "man" for locale "UTF-8" (NLSPATH = "/usr/share/locale/% l/LC_MESSAGES/% N ") no manual entry for screen [billing_dx @ bmcs1 screen-4.2.1 so I thought that if I installed a new software and wanted someone to use the man manual, what should I do. When the "man" command is used, you can manually specify the man manual for searching the specified directory. This parameter is "-M", which is explained as follows:
[billing_dx@bmcs1 screen-4.2.1]$man man-M  path       Specify the list of directories to search for man pages.  Separate the directories with colons.       An empty list is the same as not specifying -M at all.  See SEARCH PATH FOR MANUAL PAGES.
Because during screen installation, we specified the screen installation directory 【. /configure -- prefix = "/account/work/ymm/usr/local"]. Therefore, the generated executable files and corresponding instructions are all in this directory, as shown below:
[Billing_dx @ bmcs1 screen-4.2.1] $ ls/account/work/ymm/usr/localbin share [billing_dx @ bmcs1 screen-4.2.1] $ ls/account/work/ymm/usr/ local/share/info man screen [billing_dx @ bmcs1 screen-4.2.1] $ ls/account/work/ymm/usr/local/share/Man1 [billing_dx @ bmcs1 screen-4.2.1] $ so, you can manually specify the man manual Query Directory for query as follows:
[Billing_dx @ bmcs1 screen-4.2.1] $ man-M/account/work/ymm/usr/local/share/man screenSCREEN (1) SCREEN (1) NAME screen-screen manager with VT100/ANSI terminal emulationSYNOPSIS screen [-options] [cmd [args] screen-r [[pid.] tty [. host] screen-r sessionowner/[[pid.] tty [. host] DESCRIPTION ...... Of course, this method should only be a one-time method. In "laruence's private house dish", there is also a permanent method: Since there is man page, it is naturally because there are some file data, so I can read it on man page! So where can we store the man page data? Different distribution may be slightly different. However, it is usually stored in the/usr/share/man directory. However, we can solve this directory problem by modifying the man page search path! Modify/etc/man. config (some versions are man. conf or manpath. conf! For more information about man, you can use man to query man! The/etc/man. config file seems unrelated to bash at first glance, but it is also an important file for the system administrator! The content of this archive "standardizes where to find the man page path when man is used !』 To put it simply, this file specifies where to view data path settings when releasing man! So when will we modify this file? If you use the tarball method to install your data, your man page may be placed in/usr/local/softpackage/man. The softpackage is your suite name, at this time, you can manually add the path to/etc/man. in config. Otherwise, related instructions cannot be found when man is used. In fact, the most important thing in this file is the MANPATH variable setting! When searching man pages, we will search separately based on the MANPATH path! In addition, note that the region names of Linux distributions vary with different versions. For example, CentOS uses/etc/man. config, and SuSE uses/etc/manpath. config, you can use the [tab] button to complete the file name! Because the "/etc/man. config" file needs to be modified through the above method, this involves whether this permission is available.
[billing_dx@bmcs1 screen-4.2.1]$ll  /etc/man.config-rw-r--r--. 1 root root 4940 Apr  3  2012 /etc/man.config[billing_dx@bmcs1 screen-4.2.1]$
If you do not have the root permission, you cannot modify it. However, I feel that it is enough for me to use the "-M" parameter.

Append: I just found that if I add the directory where the man manual is located to the PATH environment variable, the man manual can still be directly queried. The test result is as follows:
[Billing_dx @ bmcs1 screen-4.2.1] $ man screenCannot open the message cats1 "man" for locale "UTF-8" (NLSPATH = "/usr/share/locale/% l/LC_MESSAGES/% N ") no manual entry for screen [billing_dx @ bmcs1 screen-4.2.1] $ export PATH = $ PATH: /account/work/ymm/usr/local/share/man [billing_dx @ bmcs1 screen-4.2.1] $ man screenSCREEN (1) SCREEN (1) NAME screen-screen manager with VT100/ANSI terminal emulationSYNOPSIS screen [ -Options] [cmd [args] screen-r [[pid.] tty [. host] screen-r sessionowner/[[pid.] tty [. host] DESCRIPTION. However, this method adds everything to the PATH of the environment variable is not recommended. However, this is also a method! If you have a better method, thank you for your guidance!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.