Linux-screen Common commands linux screen commands detailed Function Description: when using telnet or SSH to remotely log on to linux, if the connection is abnormally interrupted (the remote machine is closed, the system starts a new session and cannot restore the original session. 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. In my usage: 1, enable a screen and enter: screen-S test1 # Here, use-S to name the screen. It will be easier to switch later. Then, screen test1. It can run some programs. 2. Exit the screen: Ctrl-a d # Here, ctrl-a means to press ctrl and a at the same time, and then press d separately. Return to the terminal. 3. Check all the enabled screens: screen-ls # at the root, for example, 25764. test1 (Detached. 4. Enter a screen: screen-r test1 # under the root, and then enter the specified screen session, or screen-r 25764. 5. Close the session: exit # exit from the screen and return to the root. 6. Force connection, kill the original screen-D-r 20791 screen-x-r 20791 (share the original) 7, the current window is suspended, and the current window is forcibly closed, jump to the Next Ctrl-a K8 and press Ctrl-a Ctrl-[Syntax: screen [-AmRvx-ls-wipe] [-d <job Name>] [-h <number of rows>] [-r <job Name>] [-s] [-S <job Name>] Supplementary description: screen is a multi-window hypervisor. 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:-A adjusts all windows to the current terminal size. -D <job Name>: offline the specified screen job. -H <number of rows> specifies the number of buffer rows in the window. -M creates a new screen job even if the screen job is already in the job. -R <job Name> restores 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 <job Name> 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: In 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 window C-a p-> Previous, previous window C-a 0 .. 9-> switch to 0th .. 9 windowCtrl + a [Space]-> switch from window 0 to window 9C-a C-a-> switch C-a x-> lock between two recently used Windows current window, you must use your password to unlock C-a d-> detach, temporarily exit the current session, and throw the current screen session (which may contain multiple windows) to the background for execution, it will return to the status when the screen is not yet in progress. At this time, the process running in each window in the screen session (whether in the foreground or background) will continue 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 to go back. C-a w-> Windows: list the C-a t-> Time in windows that have been enabled, display the current Time, and load C-a K-> kill window in the system, 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 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 mode C-a]-> Paste for the second time and Paste the content selected in copy mode -- End --