Screen Command Simple Usage Example

November 28, 2018 1100 point heat 0 likes 0 comments


Create a new session
#Example: Create cronname
screen -S cronname
List All
screen -ls
Pause session
#C-a d in the session window
Ctrl+a and d
Offline a job
#Take cronname offline
screen -d cronname
Resume a session
#Resume session cronname
screen -r cronname
Resume offline jobs
#Resume session cronname
screen -x cronname
#This command can also be used for session sharing,
You can also see the current content synchronously on other devices (just like sitting in front of the screen)
End the session

#Do not enter, exit directly
screen -X -S cronname quit;
#Other methods
#List All sessions and view the process ID
screen -ls
#Kill the process
screen -X -S cronname quit;
other
QA:
Assuming that the session AAA is executing on terminal A,
At this point,
To continue the session on terminal B,
You can screen - d AAA first
Then screen - r AAA
OK.

QB:
Session AAA is executed on terminal A,
You want to keep terminal A displayed
View on terminal B and use
screen -x AAA
It can achieve the effect of sharing display.

The content needs to be improved.
Written on
2018-11-28 09:57:27

Gcod

If life is just like the first sight, what is the sad autumn wind painting fan

Article comments