0% found this document useful (0 votes)
521 views

Tmux Cheat Sheet & Quick Reference

This document provides a cheat sheet and quick reference for Tmux, a terminal multiplexer. It lists various Tmux commands for creating and managing sessions and windows, moving between panes, copying and pasting text, and getting help. Key bindings are shown for common tasks like detaching/attaching sessions, creating/closing windows and panes, renaming things, and switching between panes/windows.

Uploaded by

Goo Furrly
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
521 views

Tmux Cheat Sheet & Quick Reference

This document provides a cheat sheet and quick reference for Tmux, a terminal multiplexer. It lists various Tmux commands for creating and managing sessions and windows, moving between panes, copying and pasting text, and getting help. Key bindings are shown for common tasks like detaching/attaching sessions, creating/closing windows and panes, renaming things, and switching between panes/windows.

Uploaded by

Goo Furrly
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

: attach -d

Detach others on the session (Maximize window by detach other clients)

$ tmux ls
Tmux Cheat Sheet & Quick Reference
$ tmux list-sessions
Ctrl + b s
Sessions
Show all sessions
$ tmux
$ tmux a
$ tmux new
$ tmux at
$ tmux new-session
$ tmux attach
: new
Start a new session $ tmux attach-session
Attach to last session
$ tmux new -s mysession
$ tmux a -t mysession
: new -s mysession
Start a new session with the name mysession $ tmux at -t mysession
$ tmux attach -t mysession
$ tmux kill-ses -t mysession
$ tmux attach-session -t mysession
$ tmux kill-session -t mysession
Attach to a session with the name mysession
kill/delete session mysession
Ctrl + b (
$ tmux kill-session -a
Move to previous session
kill/delete all sessions but the current
Ctrl + b )
$ tmux kill-session -a -t mysession
Move to next session
kill/delete all sessions but mysession

Ctrl + b $ Windows
Rename session
$ tmux new -s mysession -n mywindow
Ctrl + b d start a new session with the name mysession and window mywindow

Detach from session


Ctrl + b c
Create window Ctrl + b }

Ctrl + b , Move the current pane right

Rename current window Ctrl + b 

Ctrl + b & Ctrl + b 


Close current window Ctrl + b 

Ctrl + b p Ctrl + b 

Previous window Switch to pane to the direction

Ctrl + b n : setw synchronize-panes


Next window Toggle synchronize-panes(send command to all panes)

Ctrl + b 0 ... 9 Ctrl + b Spacebar


Switch/select window by number Toggle between pane layouts

: swap-window -s 2 -t 1 Ctrl + b o

Reorder window, swap window number 2(src) and 1(dst) Switch to next pane

: swap-window -t -1 Ctrl + b q

Move current window to the left by one position Show pane numbers

Ctrl + b q 0 ... 9
Panes Switch/select pane by number

Ctrl + b ;
Ctrl + b z
Toggle last active pane
Toggle pane zoom

Ctrl + b %
Ctrl + b !
Split pane vertically
Convert pane into a window

Ctrl + b "
Ctrl + b + 
Split pane horizontally
Ctrl + b Ctrl + 
Ctrl + b { Ctrl + b + 
Move the current pane left
Ctrl + b Ctrl + 
Resize current pane height(holding second key is optional) Scroll down

Ctrl + b +  h
Ctrl + b Ctrl +  Move cursor left

Ctrl + b +  j
Ctrl + b Ctrl +  Move cursor down

Resize current pane width(holding second key is optional)


k
Ctrl + b x Move cursor up

Close current pane


l
Move cursor right
Copy Mode
w
: setw -g mode-keys vi
Move cursor forward one word at a time
use vi keys in buffer
b
Ctrl + b [
Move cursor backward one word at a time
Enter copy mode
/
Ctrl + b PgUp
Search forward
Enter copy mode and scroll one page up
?
q
Search backward
Quit mode
n
g
Next keyword occurance
Go to top line
N
G
Previous keyword occurance
Go to bottom line
Spacebar

Start selection
Scroll up
Esc

Clear selection
Enter Help
Copy selection
$ tmux info
Ctrl + b ] Show every session, window, pane, etc...
Paste contents of buffer_0
Ctrl + b ?
: show-buffer Show shortcuts
display buffer_0 contents

: capture-pane
copy entire visible contents of pane to a buffer

: list-buffers
Show all buffers

: choose-buffer
Show all buffers and paste selected

: save-buffer buf.txt
Save buffer contents to buf.txt

: delete-buffer -b 1
delete buffer_1

Misc
Ctrl + b :
Enter command mode

: set -g OPTION
Set OPTION for all sessions

: setw -g OPTION
Set OPTION for all windows

You might also like