Suppose that you have logged into your remote machine and started a program that will execute for sometime. What happens if you suddenly get disconnected ? A solution to that is Screen command.
sudo apt install screen
you can launch your first screen by simply typing “screen” and pressing return from the terminal.
screen -S screenname
This will start the new screen session with the given name.
If you want to display all the screen session, use
To detach from the current screen session use
screen -d screenname
To reattach to a detached session, use
screen -r screenname