tmux Cheatsheet - Terminal Multiplexer Command Reference
Essential tmux commands for remote development. Organized by session, window, pane, copy mode, and configuration — keep sessions alive when connections drop.
Back to SysOpsSession 7
tmux new -s myworkCreate a named session
tmux lsList all sessions
tmux attach -t myworkAttach to a specific session
tmux kill-session -t myworkKill a specific session
Ctrl+b dDetach from current session (session keeps running)
Ctrl+b $Rename current session
tmux kill-serverKill all sessions and the tmux server
Window 6
Ctrl+b cCreate a new window
Ctrl+b ,Rename current window
Ctrl+b n / pSwitch to next / previous window
Ctrl+b 0-9Switch to window by number
Ctrl+b &Close current window (confirms)
Ctrl+b wInteractive window list selection
Pane 7
Ctrl+b %Split pane horizontally
Ctrl+b "Split pane vertically
Ctrl+b arrowMove focus between panes
Ctrl+b zToggle pane zoom fullscreen/restore
Ctrl+b xClose current pane (confirms)
Ctrl+b { / }Swap pane positions
Ctrl+b SpaceCycle through layouts
Copy Mode 5
Ctrl+b [Enter copy mode, scroll and select text
qExit copy mode
SpaceStart selection (vi mode)
EnterCopy selected text
Ctrl+b ]Paste most recently copied text
Config ~/.tmux.conf 5
set -g mouse onEnable mouse scrolling and pane dragging
set -g base-index 1Start window numbering at 1 (default 0)
setw -g mode-keys viUse vi key bindings in copy mode
set -g default-terminal "screen-256color"Enable 256 colors, fix display issues
bind r source-file ~/.tmux.conf \; display "Reloaded!"Bind r to reload config
💡 Tips
- tmux sessions survive SSH disconnects — reattach with tmux attach after reconnecting, essential for remote development.
- Ctrl+b is the default prefix key — change it to Ctrl+a in .tmux.conf if it conflicts with terminal shortcuts.
- Text selected in copy mode goes to the tmux buffer — extra configuration is needed to sync with the system clipboard.
Official References
Commands are compiled from the official docs below. Click to verify the latest usage.
Maintained by LaoHand
Publicly updated on Jul 21, 2026, continuously proofread against official docs.
Found an error? Report it
Wrong command or description? Open an issue to help us fix it.
Found an error? Report it