Tmux Basics Cheatsheet

Published on

These are the most common commands I use in Tmux, all with the default configuration.

List existing tmux sessions

tmux ls

Create a new tmux session names statamic

tmux new -s statamic

The default command prefix is C-b (Ctrl and ‘b’ simultaneously).

Attach to the most recent session

tmux attach

Attach to the session named statamic

tmux attach -t statamic

Enable mouse control by entering the tmux command line with C-b : and enter

set -g mouse on

Mouse control allows selecting windows with the mouse and scrolling to work as expected.

Important key commands

  • C-b c - create a new window
  • C-b , - rename the current window
  • C-b $ - rename the current session
  • C-b d - detach from tmux session
  • C-b 1 through C-b 9 - switch to the corresponding window
  • C-b ' - will prompt for the window number to switch to
  • C-b p and C-b n - switch to the previous and next windows, respectively