Tmux Cheatsheet

This page presents a list of commonly used commands for tmux.

Commands

Session

# Start a new tmux session. tmux
# Start a new tmux session with name. tmux new -s <session-name>
# List all sessions. tmux ls
# Attach to the last session. tmux attach
# Attach to a session with name. tmux attach -t <session-name>
# Kill a session. tmux kill-session -t <session-name>
# Kill sessions other than the current one. tmux kill-session -a
# Kill sessions other than the named one. tmux kill-session -a -t <session-name>

Window

# Create a new window and switch to it. tmux new-window
# Create a a new window with name, but do not swith to it. tmux new-window -t -n <window-name>
# Kill the current window. tmux kill-window
# Kill the target window. tmux kill-window -t <window-name>
# Send keys to the target window. (End with C-j for enter) tmux send-keys -t <window-name> <command> C-j

Info

# Show tmux session information. tmux info

Config

# Reload config. tmux source-file ~/.tmux.conf
# Show config. tmux show-options -g

HotKeys

Session Management

C-b dDettach from session
C-b sShow all sessions
C-b $Rename sessions
C-b (Go to the previous session
C-b )Go to the next session

Window Management

C-b cCreate a new window
C-b pGo to the previous window
C-b nGo to the next window
C-b ,Rename window
C-b &Close window
C-b wList window
C-b fFind window
C-b lLast window
C-b .Move window
C-b 0...9Goto # window

Pane Management

C-b "Split horizontally
C-b %Split vertically
C-b !Convert pane to window
C-b xKill pane
C-b <arrow>Switch panes
C-b C-<arrow>Adjust pane size
C-b <space>Toggle pane layout
C-b {/}Move to Left/Right
C-b oGoto next panes
C-b ztoggle full-screen
C-b ;Toggle Last pane
C-b qShow numbers
C-b q 0...9Goto # pane