Skip to main content
Trigger using Ctrl + b (trigger) then : to enter command mode (cm) or another hotkey

1. Sessions

# Start a new session
tmux
tmux new
tmux new-session

# Start a named session
tmux new -s mysession

# Attach to existing session, or create it if it doesn't exist
tmux new-session -A -s mysession

# List all sessions
tmux ls
tmux list-sessions

# Attach to last session
tmux a
tmux attach

# Attach to a named session
tmux a -t mysession
tmux attach-session -t mysession

# Kill a named session
tmux kill-session -t mysession

# Kill all sessions except the current one
tmux kill-session -a

# Kill all sessions except a named one
tmux kill-session -a -t mysession
ShortcutAction
Ctrl+b , $Rename current session
Ctrl+b , dDetach from session
Ctrl+b , sShow / switch all sessions
Ctrl+b , (Move to previous session
Ctrl+b , )Move to next session
Ctrl+b , wSession and window preview

2. Windows (Tabs)

# Start a new session with a named window
tmux new -s mysession -n mywindow
ShortcutAction
Ctrl+b , cCreate a new window
Ctrl+b , ,Rename current window
Ctrl+b , &Close current window
Ctrl+b , wList all windows
Ctrl+b , pPrevious window
Ctrl+b , nNext window
Ctrl+b , 09Switch to window by number
Ctrl+b , lToggle last active window
# Swap window positions (e.g. swap 2 and 1)
:swap-window -s 2 -t 1

# Move current window one position left
:swap-window -t -1

# Move window between sessions
:movew -s srcSession:0 -t targetSession:9

# Renumber windows to remove gaps
:move-window -r

3. Panes (Splits)

ShortcutAction
Ctrl+b , %Split pane vertically (side by side)
Ctrl+b , "Split pane horizontally (top / bottom)
Ctrl+b , ArrowSwitch to pane in that direction
Ctrl+b , oSwitch to next pane
Ctrl+b , ;Toggle last active pane
Ctrl+b , qShow pane numbers
Ctrl+b , q 09Switch to pane by number
Ctrl+b , zToggle pane zoom (fullscreen)
Ctrl+b , !Convert pane into its own window
Ctrl+b , xClose current pane
Ctrl+b , {Move current pane left
Ctrl+b , }Move current pane right
Ctrl+b , SpacebarToggle between pane layouts
Ctrl+b , Ctrl+↑/↓Resize pane height
Ctrl+b , Ctrl+←/→Resize pane width
# Merge window 2 into window 1 as a pane
:join-pane -s 2 -t 1

# Move a specific pane between windows
:join-pane -s 2.1 -t 1.0

# Send same command to ALL panes (pair programming / multi-server)
:setw synchronize-panes

# Use vi-style keys in copy mode (recommended)
:setw -g mode-keys vi
ShortcutAction
Ctrl+b , [Enter copy mode
Ctrl+b , PgUpEnter copy mode and scroll up one page
qQuit copy mode
g / GGo to top / bottom
/ Scroll up / down
h j k lMove cursor (vi-style)
w / bMove forward / backward one word
/Search forward
?Search backward
n / NNext / previous search match
SpacebarStart selection
EnterCopy selection
EscClear selection
Ctrl+b , ]Paste buffer
# Show buffer contents
:show-buffer

# Copy entire visible pane to buffer
:capture-pane

# List all buffers
:list-buffers

# Choose buffer to paste from
:choose-buffer

# Save buffer to a file
:save-buffer buf.txt

# Delete a buffer
:delete-buffer -b 1

5. Config & Mouse

# Enter tmux command mode (from inside tmux)
# Ctrl+b :

# Enable mouse support (click to select panes/windows, scroll)
:set mouse on

# Set an option for all sessions
:set -g OPTION

# Set an option for all windows
:setw -g OPTION

6. Help & Info

# List all key bindings
tmux list-keys

# Show all sessions, windows, panes info
tmux info
ShortcutAction
Ctrl+b , ?List all key bindings (inside tmux)

Quick Reference Summary

TaskCommand / Shortcut
New named sessiontmux new -s <name>
Attach to sessiontmux a -t <name>
Detach from sessionCtrl+b , d
List sessionstmux ls
Kill sessiontmux kill-session -t <name>
New windowCtrl+b , c
Switch windowCtrl+b , 0–9
Split verticalCtrl+b , %
Split horizontalCtrl+b , "
Switch paneCtrl+b , Arrow
Zoom paneCtrl+b , z
Close paneCtrl+b , x
Enter copy modeCtrl+b , [
Paste bufferCtrl+b , ]
Enable mouse:set mouse on
Key binding listCtrl+b , ?