Linuxscreen management-ssh disconnection

Source: Internet
Author: User
Linuxscreen management-do not worry about ssh disconnection function description: when using telnet or SSH to remotely log on to linux, if the connection is interrupted abnormally, the system will open a new session when you reconnect, the original session cannot be restored. the screen command can solve this problem. Screen tool is... linux screen Management-do not worry about ssh disconnection function description: when using telnet or SSH to remotely log on to linux, if the connection is interrupted abnormally, the system opens a new session when you reconnect, the original session cannot be restored. the screen command can solve this problem. The Screen tool is a terminal multi-path adapter. in essence, this means that you can use a single terminal window to run multi-terminal applications.
Syntax: screen [-AmRvx-ls-wipe] [-d <作业名称> ] [-H <行数> ] [-R <作业名称> ] [-S] [-S <作业名称> ] Note: screen is a multi-window management program. The so-called window refers to a full-screen text screen. The screen program is usually used only when you use telnet to log on to the host or when you use an older terminal.
Parameter: www.2cto.com-A adjusts all windows to the current terminal size. -D <作业名称> Offline the specified screen job. -H <行数> Specify the number of buffer lines in the window. -M creates a new screen job even if the screen job is already in the job. -R <作业名称> Restore an offline screen job. -R first tries to restore the offline job. If an offline job cannot be found, a new screen job is created. -S specifies the shell to be executed when a new window is created. -S <作业名称> Specifies the name of the screen job. -V displays the version information. -X restores the offline screen job. -Ls or -- list displays all current screen jobs. -Wipe checks all current screen jobs and deletes unusable screen jobs.
Common screen parameters: screen-S yourname-> Create a sessionscreen named yourname-ls-> List all current sessionscreens-r yourname-> Return to yourname's sessionscreen-d yourname-> remote detach a sessionscreen- d-r yourname-> end the current session and return to yourname. this session is under each screen session, all commands start with ctrl + a (C-.
C-? -> Help. The following is a simple description: C-a c-> Create. enable windowC-a n-> Next and switch to the Next windowC-a p-> Previous, the previous windowC-a 0 .. 9-> switch to 0th .. 9 windowCtrl + a [Space]->? Window 0 in ascending order? Q? Window 9C-a C-a-> switch between the two recently used Windows C-a x-> lock the current window and use the user password to unlock C-a d-> detach, temporarily leave the current session, and throw the current screen session (which may contain multiple windows) to the background for execution and return to the status when the screen is not in progress, at this time, the process running in each window in the screen session (both the foreground and background) continues to be executed, even if logout is not affected.
C-a z-> put the current session in the background for execution, and use the shell fg command? T can be returned. C-a w-> Windows: list the C-a t-> Time In enabled windows, display the current Time, and the system's loadC-a K-> kill window, forcibly disable the current windowC-a [-> to enter the copy mode. in the copy mode, you can roll back, search, and copy data, just like using vi C-B Backward, pageUp www.2cto.com C-f Forward, PageDown H (uppercase) High, move the cursor to L Low in the upper left corner, move the cursor to 0 in the lower left corner to move the first $ w forward one word at the end of the row, move forward B backward one word in the unit of words, and move backward in the unit of words. the first time the Space is moved forward as the starting point of the marked area, press Esc to End copy modeC-a]-> Paste for the second time, and Paste the content selected in copy mode with -- End -- Conventional usage of the Screen command: screen-d-r: connects to a screen process. if the process is attached, the remote user is kicked out before the connection. Screen-D-r: connect to a screen process. if the process is attached, first kill the remote user and ask him to log out and then connect screen-ls or-list: display existing screen processes. commonly used command screen-m: If you are in a Screen process, use the shortcut key crtl + a c or directly Press screen to create a new window, screen-m can create a screen process. Screen-dm: creates a new screen and uses the detached mode by default, that is, the screen will not be connected after the screen is created. Screen-p number or name: Select a window in advance. Simple steps to run a program in the background using Screen: 1> to perform an operation, run the following command to create a Screen: [linux @ user ~] $ Screen-S test12> then you can perform operations in it. if your task is not completed yet, you must go away and use the command to keep Screen: [linux @ user ~] $ Ctrl + a + d # Press Ctrl + a, and then press d to retain Screen [detached] # This prompt is displayed, indicating that Screen www.2cto.com has been retained.
If your work is complete, enter [linux @ user ~]. $ Exit # This indicates that the [screen is terminating] is successfully exited. 3> If the Screen is retained for the last time, run the following command to view the result: [linux @ user ~]. $ Screen-lsThere is a screen on: 9649. test1 (Detached) to restore Screen, run the command: [linux @ user ~] $ Screen-r test1 (or 9649) by luojinglp
Related Article

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.