tmux Cheat Sheet

A Software › Linux cheat sheet in English by xzeqtr

Cheatsheet from tmuxcheatsheet.com

7,492 views 1,834 downloads 22 Sep 2022 History

Sessions

Start a new session
Start a new session "­mys­ess­ion­"
$tmux
$tmux new / $tmux new-session
:new
$tmux new -s mysession
:new -s mysession
kill/d­elete session mysession
Rename session
$tmux kill-ses -t mysession
$tmux kill-s­ession -t mysession
Ctrl + b $
kill/d­elete all sessions but the current
kill/d­elete all sessions but mysession
$tmux kill-s­ession -a
$tmux kill-s­ession -a -t mysession
Detach from session
Detach others on the session
Ctrl + b d
:attach -d
Attach to last session
Attach to a session "­mys­ess­ion­"
$tmux a
$tmux at
$tmux attach
$tmux attach­-se­ssion
$tmux a -t mysession
$tmux at -t mysession
$tmux attach -t mysession
$tmux attach­-se­ssion -t mysession
Show all sessions
Move to previous / next session
tmux ls
$tmux list-sessions
$Ctrl + b s
Ctrl + b ( / )
Session and Window Preview
Ctrl + b w

Misc

Enter command mode
Ctrl + b :
Set OPTION for all sessions
:set -g OPTION
Set OPTION for all windows
:setw -g OPTION
Enable mouse mode
:set mouse on

List key bindin­gs(­sho­rtcuts)
$tmux list-keys
Ctrl + b ?
:list-keys
Show every session, window, pane, etc...
$tmux info

Panes

Toggle last active pane
Ctrl + b ;
Split pane with horizontal layout
Ctrl + b %
Split pane with vertical layout
Ctrl + b "
Move the current pane left / right
Ctrl + b { / }
Switch to pane to the direction
Ctrl + b
Toggle synchr­oni­ze-­pan­es(send command to all panes)
:setw synchr­oni­ze-­panes
Toggle between pane layouts
Ctrl + b Spacebar
Switch to next pane
Ctrl + b o
Show pane numbers
Ctrl + b q
Switch­/select pane by number
Ctrl + b q 0 ... 9
Toggle pane zoom
Ctrl + b z
Convert pane into a window
Ctrl + b !

Resize current pane height
(holding second key is optional)
Ctrl + b +
Ctrl + b Ctrl +
Ctrl + b +
Ctrl + b Ctrl +
Close current pane
Ctrl + b x

Windows

Create window
Ctrl + b c
Rename current window
Ctrl + b ,
Close current window
Ctrl + b &
Previous window
Ctrl + b p
Next window
Ctrl + b n
Switch­/select window by number
Ctrl + b 0 ... 9
Toggle last active window
Ctrl + b l
Reorder window, swap window number 2(src) and 1(dst)
:swap-­window -s 2 -t 1
Move current window to the left by one position
:swap-­window -t -1

Comments

No comments yet.

Cheatography n. The art of mapping complex subjects into clear, instantly navigable reference guides.