Using gnu screen - mhulse/mhulse.github.io GitHub Wiki
# Detach -- if inside a screen session, it will leave the session open but return you to your previous terminal window
$ screen -d
# Reattach:
$ screen -r
There are several suitable screens on:
32272.pts-0.server1 (Detached)
16363.pts-1.server1 (Detached)
# If multiple, it will list the PID of the session, use that with -r to reattach to that specific session:
$ screen -r 16363
- Next screen window:
control + a + n - Previous screen window:
control + a + p - Clone (add a new one):
control + a + c - Detach:
control + a + d - Close the current window:
$ exit
(if in the last remaining window it terminates the screen session)
Java app running on server:
- Using commands above, find screen session you want to access
Note: Screens are connected to users, so you might need tosudo su <username>
- If app is running, quit it using control + C
- Assuming there’s changes you want from version control:
$ git pull
- Restart the app:
$ gradle run
- Detach screen (see commands above)
-
$ exit
(or close your terminal window)