Create and Reattach tmux Sessions

Run work inside a terminal multiplexer so SSH dropouts, laptop sleeps, and closed windows never kill your running jobs.

LinuxTerminalsessionstmuxLow risk
Run tmux new -s work to start a named session, detach with Ctrl-b d, and reattach later from any terminal with tmux attach -t work.

01Command

Command
$ tmux new -s work        # create session 'work'
tmux attach -t work    # reattach later (even from another SSH login)
# inside tmux: Ctrl-b d  detach, Ctrl-b %  split pane, Ctrl-b d then exit

02What it does

tmux keeps a server-side session alive after the client disconnects, so an overnight build or vim session survives a dropped VPN. All commands go through the prefix key Ctrl-b followed by a letter: d detaches, % and " split panes vertically and horizontally, and the session list is one tmux ls away. tmux attach -t work reconnects to exactly where you left off, from any machine that can reach the host.

03Risk

RiskLow risk
Requirementstmux (sudo apt install tmux / sudo dnf install tmux)
!Warning: Two tmux sessions with the same name can't coexist — if 'duplicate session' appears, attach instead of creating, or delete the dead one with tmux kill-session -t work.

04Undo

Undo
$ tmux kill-session -t work

05Sources

  • tmux(1) — Linux man page
    Ubuntu Manpages · technical · 2026-09-17
    Evidence: tmux man page: 'tmux is a terminal multiplexer' documenting new-session, attach-session, and detach-client.
  • Arch Wiki: tmux
    Arch Linux · community · 2026-09-17
    Evidence: Practical guide to sessions, prefix key bindings (Ctrl-b), pane splitting, and reattaching after SSH disconnects.

Last verified: 2026-09-17 · Category: Developer

06Related solutions