Post

Cheatsheet Tmux

🖥️ Tmux Cheatsheet

Table of Contents

Sessions

DescriptionShell CommandTmux CommandShortcut
Start a new sessiontmux, tmux new, tmux new-sessionnew 
Start a new session named mysessiontmux new -s mysessionnew -s mysession 
Rename session  Ctrl + b $
Detach from session  Ctrl + b d
Show all sessionstmux ls, tmux list-sessions Ctrl + b s
Attach to last sessiontmux a, tmux at, tmux attach, tmux attach-session  
Attach to session mysessiontmux a -t mysession, tmux at -t mysession, tmux attach -t mysession, tmux attach-session -t mysession  
Kill/delete session mysessiontmux kill-ses -t mysession, tmux kill-session -t mysession  
Kill all sessions but the currenttmux kill-session -a  
Kill all sessions but mysessiontmux kill-session -a -t mysession  
Move to previous session  Ctrl + b (
Move to next session  Ctrl + b )

Windows

DescriptionShell CommandTmux CommandShortcut
Create window  Ctrl + b c
Rename current window  Ctrl + b ,
Close current window  Ctrl + b &
List windows  Ctrl + b w
Previous window  Ctrl + b p
Next window  Ctrl + b n
Switch/select window by number  Ctrl + b 09
Toggle last active window  Ctrl + b l
Reorder window, swap window 2 and 1 swap-window -s 2 -t 1 
Move current window to the left swap-window -t -1 

Panes

DescriptionShell CommandTmux CommandShortcut
Split pane horizontally split-window -hCtrl + b %
Split pane vertically split-window -vCtrl + b "
Switch to pane in direction  Ctrl + b ///
Toggle between pane layouts  Ctrl + b Space
Show pane numbers  Ctrl + b q
Switch/select pane by number  Ctrl + b q 09
Toggle pane zoom  Ctrl + b z
Convert pane into a window  Ctrl + b !
Resize pane height  Ctrl + b / (hold)
Resize pane width  Ctrl + b / (hold)
Close current pane  Ctrl + b x

Copy Mode

DescriptionShell CommandTmux CommandShortcut
Enter copy mode  Ctrl + b [
Enter copy mode and scroll up  Ctrl + b PgUp
Quit mode  q
Go to top line  g
Go to bottom line  G
Move cursor  h/j/k/l
Start selection  Space
Clear selection  Esc
Copy selection  Enter
Paste contents of buffer_0  Ctrl + b ]

Misc

DescriptionShell CommandTmux CommandShortcut
Enter command mode  Ctrl + b :
Enable mouse mode set mouse on 

Help

DescriptionShell CommandTmux CommandShortcut
List key bindingstmux list-keyslist-keysCtrl + b ?
Show every session, window, pane, etc.tmux info  

This post is licensed under CC BY 4.0 by the author.