tmuxcheatsheet.org
The ultimate interactive guide to terminal multiplexing.
Search, copy, and customize your terminal workflow.
tmux newStart a new session
tmux new -s [name]Start a new named session
tmux new -A -s [name]Attach to session or create it if missing
tmux aAttach to last session
tmux a -t [name]Attach to a named session
tmux lsList all sessions
tmux kill-ses -t [name]Kill a named session
tmux kill-ses -aKill all sessions except current
tmux kill-ses -a -t [name]Kill all sessions except named
tmux kill-serverStop tmux server & all sessions
tmux rename-session -t [old] [new]Rename a session via CLI
tmux new -s [session] -n [window]New session with named window
dDetach from current session
sList & switch sessions
$Rename current session
(Switch to previous session
)Switch to next session
LSwitch to last session (previously active)
:Enter tmux command prompt
: attach -dDetach all other clients from session
cCreate a new window
,Rename current window
wList all windows
nNext window
pPrevious window
lToggle last active window
fFind window by name
0-9Switch to window by number
&Kill current window
.Move window to a different index
: swap-window -s 2 -t 1Swap window positions
: move-window -rRenumber windows (remove gaps)
: move-window -s src:win -t dstMove window to another session
"Split pane horizontally
%Split pane vertically
oGo to next pane
;Toggle last active pane
xKill current pane
zToggle pane zoom (fullscreen)
!Break pane into new window
{Move pane left
}Move pane right
Arrow KeysNavigate between panes
Ctrl+Arrow KeysResize pane by 1 cell
Alt+Arrow KeysResize pane by 5 cells
SpaceCycle pane layouts
mMark pane
MClear mark
qShow pane numbers
tShow clock
: join-pane -s 2 -t 1Merge window into panes
: setw synchronize-panesToggle input broadcast to all panes
[Enter copy mode
]Paste from buffer
SpaceStart selection
EnterCopy selection & exit
EscCancel selection
qExit copy mode
PageUpEnter copy mode & scroll up
PageDownScroll down (in copy mode)
Arrow KeysMove cursor (in copy mode)
h / j / k / lVi cursor navigation
w / bMove forward / backward by word
/Search forward
?Search backward
n / NNext / previous match
g / GGo to top / bottom
: show-bufferShow buffer contents
: list-buffersList all buffers
: choose-bufferSelect buffer to paste
: save-buffer file.txtExport buffer to file
: setw -g mode-keys viEnable vi keybindings
?Show all keybindings
tmux lskList all shortcuts (CLI)
~Show messages
tmux source ~/.tmux.confReload config file
Ctrl-bDefault Prefix key
rReload config (if bound)
iShow window info
: set mouse onEnable mouse mode
: set -g OPTIONSet option for all sessions
: setw -g OPTIONSet option for all windows
tmux infoShow all sessions, windows & panes info
01. The Prefix
Most commands in tmux are preceded by a prefix key. Your current prefix is Ctrl-b.
02. Command Mode
Press Prefix + : to enter command mode where you can type any tmux command directly.
03. Persistence
The power of tmux is that sessions persist even if you close your terminal or lose your connection.