Skip to content

Tmux Cheat Sheet

This page contains a list of commonly used commands that I use working with tmux.

How to use tmux commands?

All commands in tmux are triggered by a prefix key C-b followed by a command key.

For example, to split panes into top and bottom, use C-b ". This simply means press the Ctrl and b keys at the same time, then release it and type the symbol in this case ".

How to start tmux session?

  • tmux
  • tmux new -s database create new "named" session (easier to switch later)

How to create new pane in tmux?

  • C-b % split panes into left and a right
  • C-b " split panes into top and bottom

How to switch between panes in tmux?

  • C-b <arrow key>

How to close pane in tmux?

  • hit Ctrl-d
  • type exit

How to create new window in tmux?

  • C-b c create new window
  • C-b p switch to previous
  • C-b n switch to next
  • C-b <number> where <number> is the number in front of the window’s name in your status bar

How to switch sessions in tmux?

  • tmux ls list current sessions
  • C-b d detach your current session
  • C-b D detach with choice
  • tmux attach -t 0 connect to session
  • tmux new -s database create new database session
  • tmux rename-session -t 0 database rename session to database
Back to top