Screen
Processes running in Screen will continue to run when their window is not visible even if you get disconnected
INFO
Original article: linuxize.com/post/how-to-use-linux-screen
Installation
sudo apt update -y ; sudo apt -y install screensudo yum install screenUsage
Execute a new screen.
screenValid screen with Enter key and you are into a screen, you can execute any command with a really long time of execution. After this, you can detach screen with Ctrl+A D. You will be back into SSH session, you can get back your screen with screen -r to reattach it if you have one screen.
Now you can check yours screens with screen -ls and reattach any with ID like 10835.pts-0.linuxize-desktop (Detached) with screen -r 10835.
Of course you can exit SSH session and screen will continue to execute command in background.
Commands
Ctrl+acCreate a new window (with shell).Ctrl+a"List all windows.Ctrl+a0Switch to window 0 (by number).Ctrl+aARename the current window.Ctrl+aSSplit current region horizontally into two regions.Ctrl+a|Split current region vertically into two regions.Ctrl+atabSwitch the input focus to the next region.Ctrl+aCtrl+aToggle between the current and previous windowsCtrl+aQClose all regions but the current one.Ctrl+aXClose the current region.Ctrl+adDetach from the screen session, the program running in the screen session will continue to run after detach.
Cheatsheet
Version
screen --versionList
screen -lsThere are screens on:
10835.pts-0.linuxize-desktop (Detached)
10366.pts-0.linuxize-desktop (Detached)
2 Sockets in /run/screens/S-linuxize.Connect to a screen:
screen -r 10835Reattach
If you have only one screen session you can reattach it by typing:
screen -rKill
To delete all detached screens:
pkill screen