Skip to content

Instantly share code, notes, and snippets.

@ojroques
Last active May 14, 2021 17:06
Show Gist options
  • Save ojroques/f3251161ee96b74f993e516e3aa1c6d1 to your computer and use it in GitHub Desktop.
Save ojroques/f3251161ee96b74f993e516e3aa1c6d1 to your computer and use it in GitHub Desktop.
tmux cheatsheet

TMUX cheatsheet

prefix refers to CTRL-b by default.

Session management

  • Create a new tmux session named session_name:
tmux new -s session_name
  • Attach to an existing tmux session named session_name:
tmux a -t session_name
  • Switch to an existing session named session_name:
tmux switch -t session_name
  • List existing tmux sessions: prefix s or
tmux ls
  • Detach the currently attached session: prefix d or
tmux detach
  • Kill an existing tmux session named session_name:
tmux kill-session -t session-name
  • Rename the current session to session_name: prefix $ or
tmux rename-session -t session_name

Window management

  • Create a new window: prefix c
  • Move to the next window: prefix n
  • Move to the previous window: prefix p
  • Rename the current window: prefix ,
  • Select windows 0 through 9: prefix 0-9
  • List windows: prefix w
  • Kill the current window: prefix &

Pane management

  • Create a horizontal pane: prefix %
  • Create a vertical pane: prefix "
  • Switch to next pane: prefix o
  • Move between panes: prefix arrow-keys
  • Enable scrolling: prefix [
  • Toggle fullscreen: prefix z
  • Resize pane: hold prefix arrow-keys
  • Swap with next pane: prefix }
  • Swap with previous pane: prefix {
  • Kill the current pane: prefix x

Copy and paste

  • Enter copy mode: prefix [
  • Start selection: CTRL-Space
  • Copy into tmux clipboard: ALT-w
  • Paste from tmux clipboard: prefix ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment