Linux screen tool notes

Source: Internet
Author: User

After exiting SSH in Linux, the command being executed will be interrupted. Even if the task is executed in the background, the output information will not be displayed the next time you enter ssh.

Screen simulates multiple windows. When you exit SSH, the tasks executed in screen are not affected. Next time you log on to SSH, you only need to switch to the specified screen window, the task execution process and result are displayed.

If you have been using a Windows server, you can enjoy this convenience.

Centos is directly installed through Yum install screen.

Create a screen window named windows1:

] # Screen-s windows1

Enter a new interface that is exactly the same as SSH, and execute any command in it. For example

] # Ping www.csdn.net

The Ping will continue. At this time, press Ctrl + A and then press d to "minimize" the window and return to the previous SSH interface.

View Current windows

] # Screen-ls

There is a screen on:
24502. windows1 (detached)
1 socket in/var/run/screen/S-root.

We can see that there is a window named windows1 in the background. At this time, you can directly close SSH, log on again, and execute screen-ls.

Open Window

] # Screen-r windows1

Or

] # Screen-r 24502

In the windows1 window, you can see that ping is still being executed and the process is running.

Press Ctrl + C to terminate the current process

Press Ctrl + D to end the current window and return it to ssh.

If multiple windows need to end, you can directly killall Screen

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.