tmux and screen: several terminals in one
In short: tmux (and the older screen) is a terminal multiplexer: you have several windows in one session, and the session keeps running even if the connection (for example SSH) drops.
Why it is useful
Long jobs (updates, compiling, downloads) would otherwise stop when you lose the connection or close the window. In tmux the session keeps running on the server and you attach again later.
Most important commands
The prefix is Ctrl+B, followed by a key.
tmuxstarts a session,tmux new -s namewith a name.Ctrl+B ddetaches the session (it keeps running).tmux attach -t namereconnects;tmux lslists.Ctrl+B cnew window,Ctrl+B n/pnext/previous.Ctrl+B %splits vertically,Ctrl+B "horizontally,Ctrl+B+ arrow switches the pane.Ctrl+B [scroll mode (leave withq).
screen
Similar, prefix Ctrl+A: screen -S name, detach with Ctrl+A d, screen -r name. It is older and simpler; tmux is more common today.
Tip
On remote servers you get used to it: tmux first, then work. A file ~/.tmux.conf allows own settings, see Dotfiles and configuration management.
See also: Terminal text editors