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. use nohup to solve this problem. put the program in the background and view nohup. out to view the program running, but use nohu

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 is not installed by default. install it.

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-S ipcpu, uses the named socket for easy input.
Another user can use screen-x ipcpu. The two users can work together to perform operations. 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.

Quick turn 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. Disable the flash screen in vi.: Set novisualbellCommand.

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.