Linux virtual terminal command Screen usage

Source: Internet
Author: User

Linux virtual terminal command Screen usage details after using ssh or telnet to log on to the remote host, execute some time-consuming commands. If ssh or telnet is interrupted at this time, the program or command being executed on the remote host will also be terminated. For example, after you log on remotely, You need to execute a time-consuming command such as svn checkout. Now you are about to get off work again. What should you do if you close your computer and leave? Screen can solve this problem well. Screen is also called a virtual terminal. It can achieve the effects of multiple virtual terminals on one physical terminal. General Usage: 1. Create a screen Direct screen or screen-s xxx (XXX is the name you specified for this screen) 2. Create a new virtual terminal in screen (now you have two virtual terminals in screen) ctrl + a + c (press ctrl + a first, then press c, the following command is the same) 3. Switch the previous ctrl + a + p and the Next ctrl + a + n list to ctrl + a + shift + "4. Close a virtual terminal ctrl + a + k or exit5. Pause the screen. (After the screen is suspended, you return to the shell that creates the screen) ctrl + a + d6, reconnect screenscreen-ls to list the currently suspended screen. For example, there is such a "8888.XXX (Detached) you can use screen-r 8888 or screen-r XXX to reconnect. The problem at the beginning of the article should be solved. After you connect to the remote host, do not rush to run your commands, but create a screen first, then, run your command in the screen virtual terminal. Before you disconnect the connection, pause the screen. The next time you connect, you only need to reconnect to your screen, you will find that your commands have been executed or are being executed, rather than being interrupted. Generally, the above usage is sufficient. If you need more, directly use screen -- help. By the way, the general release does not include this software. You need to install it on your own, and sudo apt-get install screen will be taken directly under ubuntu.

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.