screen lets you keep terminal sessions running even after disconnecting from SSH. It is useful for long-running jobs, remote administration and working with multiple shell windows inside one connection.
Start a screen session
screen
You can also name the session so it is easier to find later.
screen -S maintenance
Detach and reattach
To detach from a running session, press Ctrl-a then d. The command inside screen keeps running.
screen -ls
screen -r maintenance
Common shortcuts
Ctrl-a d: detach from the sessionCtrl-a c: create a new windowCtrl-a n: move to the next windowCtrl-a p: move to the previous window
For new systems, tmux is also a popular alternative, but screen remains useful on many servers.