How to safely abandon an ubuntu session? [duplicate]

The screen and tmux applications are terminal multiplexers

You can run virtual terminals, and attach/detach without disturbing the ongoing process.

Both are in the Ubuntu repositories.