When using ssh remote connection linux server work, for example, need to compile some programs and then the network is unstable, the work will be dry, and the reconnection will repeat the work, this time Screen can come in handy.
Cultivate good habits and use screen!
1. Install screen
--------------------- ------------
yum install screen
----------------------- ---------
2.Run screen
------------------------- -------
screen
------------------------------ --
3. Usage
Ctrl+a Then press c to create a new screen session
Ctrl+a then press n to jump to the next screen session
Ctrl+a then press p to return to the previous screen session
Ctrl+a and press d to place the current screen session in the background.
Ctrl+a then press (uppercase S Separate a screen session, separate it and use Ctrl+a and then tab to jump between the separated screens.
screen -ls List all current screen sessions
screen -r process number before Ctrl+a and then press d to place the session in the background call back.
If there is a sudden disconnection in ssh, then after you log in again, screen -ls will find that the status of the screen is in the (Attached) state. At this point we use screen -d to force him into the background, and then use Screen -r The process number calls him back.
If screen -ls sees a dead session, you can kill him with the screen -wipe process number.
eg:
#screen -list can see the running screen instance
There is a screen on:
80338.ttyp3.chh ( Detached)
1 Socket in /tmp/screens/S-chh.
Back screen -r 80338
Exit completely: #exit
Screen provides Two main functions:
Run multiple terminal sessions in one terminal.
A started program is separated from the real terminal that runs it, so it can run in the background. The real terminal can be turned off, and it can be reattached later at
.
Short instance
Open screen:
# screen
In a screen session, we can open a long-running program (such as top). Detach this terminal, you can then
reattach this same terminal from other machines (eg via ssh).
# top
Now Ctrl-a Ctrl-d to detach. Reattach Terminal:
# screen -r
or better:
# screen -R -D
Attach now here. The specific meaning is: first try to restore the offline screen session. If an offline screen session is not found, a new
screen session is created for the user.
Screen Command (in screen)
All commands start with Ctrl-a.
Ctrl-a ? Help Summary for each function
Ctrl-a c Create a new window (terminal)
Ctrl-a Ctrl-n and Ctrl-a Ctrl -p switches to the next or previous window
Ctrl-a Ctrl-N N is a number from 0 to 9 to switch to the corresponding window
Ctrl-a " Navigable list of all running windows
Ctrl-a a Clear Ctrl-a
Ctrl-a Ctrl-d Disconnect all sessions, all tasks in the session run in the background
Ctrl-a x With the password lock screen screen terminal
When the program internal terminal is closed and you log out of the terminal, the screen session is terminated.
screen is really a favorite tool, in addition to bringing you a lot of convenience when managing remote sessions, today I also found a very useful feature, synchronous display of your screen to another Conversation. This is especially useful for dealing with others, allowing the other party to see your actions simultaneously, leaving a lot of explanations to describe the work.
Method:
a. Both parties log in to the system at the same time
b. The demo side runs:
screen -S yahunet
c. Viewer running:
screen -x yahunet
Many Linux enthusiasts consider the hardware configuration to be compatible with Linux systems when
With the increasing use of Linux, there are a large number of network servers using the Linux operat
First, what is haproxyHAProxy provides high availability, load balancing, and agents based on TCP a
Too many open files Errors are common faults in Linux systems. Solutions can be easily found on the
Set up a personal Bluetooth LAN under Linux
Linux boot will not start the network card problem
Executing commands in Linux; the difference between &&
How to check HTTP traffic on Linux
Linux hard disk error report (you must specify the filesystem type)
Automotive industry dealing with the Linux operating system
NVIDIA graphics driver installed under Linux system
The most commonly used network commands in Linux and Unix systems
The mystery of the Windows series startup speed difference
Win8 Encyclopedia 58: Win8 comes with disk partitioning tool tutorial
Internet cafe diskless workstation maintenance knowledge
Win7 system upgrade PP assistant prompts "initialize database failure" how to solve
Win8 system recovery function can restore the system in a few easy times (2)
How does Win8 turn off input text conversion error report reminder (very annoying)
Microsoft announced on Tuesday that six security patches do not involve Windows7
CF Singles Festival Needs Weapons Limited Time Spike Activity Website