← Knowledge Base
LinuxReference note1 min read · updated 2026-11-27

tmux: keep terminal sessions alive

Start, detach and re-attach sessions so long jobs survive a dropped SSH connection.

tmuxsshterminal
tmux new -s work          # new named session
# Ctrl+b then d           # detach (the session keeps running)
tmux ls
tmux attach -t work       # come back
tmux kill-session -t work

Inside a session: Ctrl+b % splits left/right, Ctrl+b " splits top/bottom, Ctrl+b o moves between panes, Ctrl+b c opens a new window, Ctrl+b n/p switch windows, Ctrl+b [ enters scroll mode (q to leave). Install it with sudo apt install tmux.