tmux
Here’s a list of common tmux
commands and keybindings to help you manage your terminal sessions effectively:
Basic Commands
Start a New Session:
Or give it a name:
Detach from a Session:
Press
Ctrl-b
followed byd
.
List Sessions:
Attach to a Session:
Kill a Session:
Window and Pane Management
Create a New Window:
Press
Ctrl-b
followed byc
.
Switch Between Windows:
Press
Ctrl-b
followed byn
(next) orp
(previous).Or press
Ctrl-b
followed by the window number (e.g.,1
,2
).
Rename a Window:
Press
Ctrl-b
followed by,
(comma), then type the new name.
Close the Current Window:
Type
exit
in the current window or pressCtrl-d
.
Split the Window Horizontally:
Press
Ctrl-b
followed by%
.
Split the Window Vertically:
Press
Ctrl-b
followed by"
(double quote).
Navigate Between Panes:
Press
Ctrl-b
followed by the arrow keys.
Resize Panes:
Press
Ctrl-b
followed by:
to enter command mode, then use the resize commands:resize-pane -L
(left)resize-pane -R
(right)resize-pane -U
(up)resize-pane -D
(down)
Close the Current Pane:
Type
exit
in the current pane or pressCtrl-d
.
Session and Pane Commands
Create a New Pane:
Press
Ctrl-b
followed by%
(vertical split) or"
(horizontal split).
Swap Panes:
Press
Ctrl-b
followed byo
to swap between panes.
Synchronize Panes:
Press
Ctrl-b
followed by:
and typesetw synchronize-panes on
to type the same command in all panes. Usesetw synchronize-panes off
to turn off synchronization.
Send a Command to All Panes:
Press
Ctrl-b
followed by:
and typesend-keys 'command' C-m
to send a command to all panes in the current window.
Copy and Paste Mode
Enter Copy Mode:
Press
Ctrl-b
followed by[
.
Navigate in Copy Mode:
Use arrow keys,
Page Up
, andPage Down
.
Start Selection:
Press
Space
to start selecting text.
Copy Selection:
Press
Enter
to copy the selected text to the clipboard.
Paste Text:
Press
Ctrl-b
followed by]
.
Configuration
Edit the
.tmux.conf
File: Create or edit~/.tmux.conf
to customize keybindings and settings. After editing, reload the configuration with:
Last updated