Skip to content

Tmux Terminal Multiplexer Cheat Sheet

Tmux is a terminal multiplexer that allows you to run multiple terminal sessions in a single terminal window. It allows users to view and control multiple terminal sessions on one screen simultaneously and switch between them.

Session Management

tmux new -s <session-name>

Create a new session and name it .

tmux attach -t <session-name>

Attach to an existing session.

tmux detach

Detach from the current session.

tmux ls

List all sessions.

tmux kill-session -t <session-name>

Kill a session.

Window Operations

tmux new-window -n <window-name>

Create a new window and name it .

tmux select-window -t <window-name>

Select a window.

tmux rename-window -t <window-name> <new-name>

Rename a window.

tmux kill-window -t <window-name>

Kill a window.

Pane Switching

tmux split-window -h

Split the current window horizontally.

tmux split-window -v

Split the current window vertically.

tmux select-pane -t <pane-id>

Select a pane.

tmux kill-pane -t <pane-id>

Kill a pane.

Shortcuts

Shortcut Function
Ctrl-b c Create a new window
Ctrl-b n Switch to the next window
Ctrl-b p Switch to the previous window
Ctrl-b w List all windows
Ctrl-b , Rename the current window
Ctrl-b % Split the current window horizontally
Ctrl-b " Split the current window vertically
Ctrl-b o Switch to the next pane
Ctrl-b x Kill the current pane
Ctrl-b d Detach from the current session
Ctrl-b ? Show all shortcuts