Screen is a terminal multiplexer which has the added benefit of running even when you’re not connected to the server anymore. This is particularly useful for long operations or operations that are a pain to revert if interrupted.
Start a screen session with screen -S $screen_name
and make sure you’re descriptive so following up isn’t a pain!
Run the desired program while in the screen and then use ctrl+a
(the control key)to specify you want to issue commands to screen instead of shell. d
will then detach you from the screen while leaving it intact.
Back in your own terminal you can seee a list of all active screens using screen -ls
but do be aware that this is user specific. To reattach one of them to your active terminal, execute screen -r $screen_ID
When in a screen you can just use exit
as normal to close it or ctrl+a
?
to bring up the screen command help man. ctrl+a
esc
will let you scroll through a command history if needs be.