Use of the screen command in Centos

Source: Internet
Author: User

Screen is a good thing. It has been used for a few days.

If you encounter some time-consuming programs, but you can't keep on the computer to observe him, you always have to close the computer after work, then screen will come in handy.

1. If you open a window in screenCRT and run a program, the program will be automatically destroyed when it is canceled.
2. you can use nohup to solve this problem. You can run the program in the background and view nohup. you can view the program running out, but you can use nohup to put the program in the background, and you can no longer switch the program to the foreground, while screen can.

Usage:

1. Install centos. It is not installed by default. Install centos.

2. Go to screen.

Enter screen and press enter to enter a new terminal. You can run a job for a long time.

3. Return to the main terminal (screen is still running in the background)
Ctrl + A and then press D to display [detached]

4. Return to screen
Screen-ls
There is a screen on:
18245. pts-1.imobile-sv006-200 (Detached)
1 Socket in/var/run/screen/S-root.
You can see all the screen sockets. Use screen-r 18245 to return the result.

5. Completely exit screen
On the screen terminal, enter exit. [Screen is terminating]

6. screen sharing and collaboration

One user, screen-Sipcpu, uses the named socket for easy input.
Another user can use screen-xipcpu. The two users can work with each other and the operations of one party are displayed on the screen of the other.

Other screen commands
Ctrl-? Help summary of each function
Ctrl-a c create a new window (Terminal)
Ctrl-a Ctrl-n and Ctrl-a Ctrl-p switch to the next or previous window
Ctrl-a Ctrl-N is a number ranging from 0 to 9, used to switch to the corresponding window
Ctrl-a "to get the navigation list of all running Windows
Ctrl-a clear and incorrect Ctrl-
Ctrl-a Ctrl-d disconnect all sessions, and all tasks in the session run on the background
Ctrl-a x use password lock column screen Terminal

====================================

Postscript

When using screen, you will often encounter the problem of "Flashing screen", which can be turned off.

Fast switch off: Enter CTRL + a, and then CTRL + g.

Permanently close: ModifyAdd/etc/screenrc

Vbell off

In fact, this is similar to the visual Bell function in vi. To disable the pop-up screen in vi, use the: set novisualbell command.

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.