Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use the Screen command in Linux

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article will explain in detail how to use the Screen command in Linux. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.

Overview

Screen is a free software developed by GNU for command line terminal switching; users can connect multiple local or remote command line sessions at the same time and switch freely between them. GNU Screen can be thought of as the command-line interface version of the window manager. It provides a unified interface for managing multiple sessions and corresponding functions.

Official website: http://www.gnu.org/software/screen

Syntax:

# screen [- AmRvx-ls-wipe] [- d] [- h] [- r] [- s] [- S]

Option value:

-An adjusts all windows to the size of the current terminal. -d takes the specified screen job offline. -h specifies the number of buffer rows for the window. -m forces the creation of a new screen job even if it is already in the job. -r resumes offline screen jobs. -R first attempts to resume offline jobs. 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 version information. -x resumes previously offline screen jobs. -ls or-- list displays all current screen jobs. -wipe checks all current screen jobs and deletes screen jobs that are no longer available.

Common parameters of screen

Screen-S yourname-> create a new sessionscreen-ls called yourname-> list all current sessionscreen-r yourname-> go back to the sessionscreen-d yourname of yourname-> remote detach some sessionscreen-d-r yourname-> end the current session and return to the session of yourname

Under Session, use ctrl+a (Cmura)

Cmura?-> display all key binding information Cmura c-> create a new window running shell and switch to this window Cmura n-> Next, switch to the next window Cmera p-> Previous Switch to the previous windowC-a 0.9-> switch to the 0.9th windowCtrl+a [Space]-> switch from window 0 to window 9C-a Cmura-> switch between the two recently used window x-> lock the current window, unlock the current session with the user password, temporarily leave the current session, and throw the current screen session (which may contain multiple windows) to the background for execution. And will return to the state before the screen, when in the screen session, the process (whether foreground / background) running in each window continues to execute, even the logout does not affect. Cmura z-> put the current session to be executed in the background, and you can go back with shell's fg command. Cmura w-> displays the list of all windows Cmura t-> time, shows the current time, and the system's load Cmura k-> kill window, forcibly closes the current windowC-a [- > enter copy mode, and rolls back, searches, and copies under copy mode just like using vi, Cmurb Backward,PageUp Cmurf Forward,PageDown H (uppercase) High, move the cursor to the upper left corner L Low Move the cursor to the lower left corner 0 to the end of the line $w forward one word, move forward b backward one word by word, move backward by word Space first press as the starting point of the marked area, press the second press as the end Esc to end copy mode Cmura]-> paste, paste what you have just selected in copy mode

After common operation

Create session (- m force): screen-dmS session name

Close the session: screen-X-S [session # you want to kill] quit

View all sessions: screen-ls

Enter the session: screen-r session_name

Install screen under Linux

[root@TS-DEV ~] # yum install screen [root@TS-DEV ~] # rpm-qa | grep screenscreen-4.0.3-4.el5 [root@TS-DEV ~] # this is the end of the article on "how to use Screen commands in Linux". I hope the above content can be helpful to you so that you can learn more knowledge. if you think the article is good, please share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report