Avatar

Tmux Cheat Sheet

Oct 10, 2025

#CLI

A quick reference guide for the most common tmux commands and shortcuts.

Important

The default prefix for all commands is Ctrl+b. Press the prefix combination, release it, and then press the command key.

Session Management

Tmux sessions allow you to manage multiple terminal environments.

CommandDescription
tmux new -s <name>Create a new named session.
tmux lsList all active sessions.
tmux attach -t <name>Attach to a named session.
tmux kill-session -t <name>Kill a named session.
Ctrl+b dDetach from the current session.
Ctrl+b $Rename the current session.

Window Management

Windows are like tabs in a browser.

ShortcutDescription
Ctrl+b cCreate a new window.
Ctrl+b ,Rename the current window.
Ctrl+b pSwitch to the previous window.
Ctrl+b nSwitch to the next window.
Ctrl+b <number>Switch to a window by its number (e.g., Ctrl+b 1).
Ctrl+b wList all windows.
Ctrl+b &Kill the current window.

Pane Management

Panes allow you to split a window into multiple terminals.

ShortcutDescription
Ctrl+b %Split the current pane horizontally.
Ctrl+b "Split the current pane vertically.
Ctrl+b oSwitch to the next pane.
Ctrl+b <arrow-key>Navigate between panes using arrow keys.
Ctrl+b qBriefly show pane numbers.
Ctrl+b xKill the current pane.
Ctrl+b zToggle zoom for the current pane.
Ctrl+b {Swap with the previous pane.
Ctrl+b }Swap with the next pane.

Copy Mode

Tmux has a "copy mode" that allows you to scroll back and copy text from the terminal history.

  • Enter Copy Mode: Ctrl+b [
  • Navigate: Use arrow keys, PageUp, PageDown.
  • Start Selection: Space
  • Copy Selection: Enter
  • Paste: Ctrl+b ]
  • Exit Copy Mode: q

Other Useful Commands

ShortcutDescription
Ctrl+b ?Show all key bindings.
Ctrl+b :Enter the tmux command prompt.
Ctrl+b rForce redraw of the attached client.
>