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 rightC-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 windowC-b p
switch to previousC-b n
switch to nextC-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 sessionsC-b d
detach your current sessionC-b D
detach with choicetmux attach -t 0
connect to sessiontmux new -s database
create newdatabase
sessiontmux rename-session -t 0 database
rename session todatabase