(1) Create a session
Use the command "Screen-s runwork" to create a screen session, the command executes, you will get a new shell window, in order to facilitate the marking can be used shortcut key Ctrl-a A (that is, press the CTRL + a key, and then press Shift+a), This way the cursor on the window prompts the window to be renamed. After entering the name "Runworkwindow", the carriage return completes the renaming of the window. The renaming here is to avoid confusing different windows in the same session, and you can use the Ctrl-a W shortcut to view the current window name
(2) Run the job session detach and resume
Ctrl-a D: Detach the current session so that, even if the network is disconnected or the SSH client is shut down, the job will still run on the server;
Screen-ls: See what sessions are currently in and their respective States;
Screen-r SessionID: Restores an already detach session (SessionID is the number in front of each session in the SCREEN-LS command result), and after the session is restored, you can see the input results and output information of the session on the command line.
(3) Screen-x window name: Replace Window
(4) Ctrl-a D:kill session
Mac Terminal Screen Command usage guide