Tmux Keyboard Shortcuts

Tmux Cheatsheet 00 Featured Image

Tmux is a simple yet powerful terminal multiplexer for UNIX-based machines. It allows you to seamlessly create and manage multiple terminal windows from a single teletype terminal (TTY). Tmux does this by creating self-contained pseudo-terminals which it serves to the user. This approach allows tmux to create terminal windows that persist across sessions. Not only that, this also allows it to easily transfer information and modify different terminals.

Because of that, tmux is a staple program for both everyday users and system administrators alike. Its ability to provide a persistent terminal session means that you can run tmux remotely and run programs without the risk of terminating them upon disconnecting. Furthermore, its ability to manipulate terminal windows makes it a simple window manager for power users.

Tmux Keyboard Shortcuts Download

Download this Cheatsheet

Enter your email below to receive this PDF cheatsheet in your Inbox.

Essential Tmux Keybindings

Although tmux offers many benefits, one key difficulty new users run into with tmux is its unusual and unintuitive keybinding syntax. While it is possible to remap the tmux keybinding in your system, you may not be able to load a custom configuration into every system you might work with. Therefore, you will likely still want to know how the default tmux system works. This cheatsheet aims to teach you the basics of how to use tmux’s arcane bindings.

ShortcutFunction
General Keybindings
Ctrl + BThe default leader key.
Ctrl + B, then ?Open tmux’s help menu.
Ctrl + B, then ~Display all the system messages for the current session.
Ctrl + B, then Ctrl + BSend the leader key through the terminal.
Ctrl + B, then :Open the command buffer.
Ctrl + B, then Ctrl + ZSuspend the current tmux client.
Ctrl + B, then DDetach the current session from the active terminal.
Ctrl + B, then Shift + DOpen a prompt to select which session to detach.
Ctrl + B, then SSwitch to a different session.
Ctrl + B, then (Move the current client to the previous session.
Ctrl + B, then )Move the current client to the next session.
Ctrl + B, then RRedraw the current screen.
Ctrl + B, then TShow the current time.
Window Management
Ctrl + B, then CCreate a new window.
Ctrl + B, then &Delete the currently selected window.
Ctrl + B, then IBriefly display information about the currently selected window.
Ctrl + B, then NGo to the next window in the session.
Ctrl + B, then PGo to the previous window in the session.
Ctrl + B, then Alt + NGo to the next window with a marker.
Ctrl + B, then Alt + PGo to the previous window with a marker.
Ctrl + B, then ,Change the label of the current window.
Ctrl + B, then .Change the index number of the current window.
Ctrl + B, then LGo back to the previously selected window.
Ctrl + B, then 0-9Go to the window with the corresponding index number.
Ctrl + B, then ‘Open a prompt to directly switch to a specific index number.
Ctrl + B, then WOpen a prompt to interactively select the window to switch to.
Ctrl + B, then FSearch for windows that contain a specific text string.
Pane Management
Ctrl + B, then QShow the pane index for the currently visible screen.
Ctrl + B, then %Create a new vertically split pane in the current window.
Ctrl + B, then “Create a new horizontally split pane in the current window.
Ctrl + B, then XDelete the currently selected pane.
Ctrl + B, then !Put the currently selected pane to a different window.
Ctrl + B, then ;Select the previously active pane.
Ctrl + B, then MMark the current pane.
Ctrl + B, then Shift + MUnmark the current pane.
Ctrl + B, then OSelect the next pane in the currently selected window.
Ctrl + B, then {Swap the currently selected pane with the previous one in the index.
Ctrl + B, then }Swap the currently selected pane with the next one in the index.
Ctrl + B, then UpSelect the pane above the currently selected pane.
Ctrl + B, then DownSelect the pane below the currently selected pane.
Ctrl + B, then LeftSelect the pane on the left of the currently selected pane.
Ctrl + B, then RightSelect the pane on the right of the currently selected pane.
Pane Layouts
Ctrl + B, then Alt + 1Arrange the layout of the panes in the current window to a horizontally stacked layout.
Ctrl + B, then Alt + 2Arrange the layout of the panes in the current window to a vertically stacked layout.
Ctrl + B, then Alt + 3Arrange the layout of the panes in the current window to a horizontal master-stack layout.
Ctrl + B, then Alt + 4Arrange the layout of the panes in the current window to a vertical master-stack layout.
Ctrl + B, then Alt + 5Arrange the layout of the panes in the current window to a tiled layout.
Ctrl + B, then SpaceCycle through all of the default layouts in the current window.
Ctrl + B, then Ctrl + UpIncrease the size of the currently selected pane by one row upwards.
Ctrl + B, then Ctrl + DownIncrease the size of the currently selected pane by one row downwards.
Ctrl + B, then Ctrl + LeftIncrease the size of the currently selected pane by one row leftwards.
Ctrl + B, then Ctrl + RightIncrease the size of the currently selected pane by one row rightwards.
Text Copy Mode
Ctrl + B, then [Switch the current session to tmux’s text copy mode.
GGo to the top line of the current window.
Shift + GGo to the bottom line of the current window.
/Do a forward search for a keyword.
?Do a backward search for a keyword.
NHighlight the next occurrence of a keyword.
Shift + NHighlight the previous occurrence of a keyword.
K
Up Arrow
Move the cursor one line upwards.
J
Down Arrow
Move the cursor one line downwards.
H/Left ArrowMove the cursor one character leftwards.
L/Right ArrowMove the cursor one character rightwards.
WMove the cursor one word forward.
BMove the cursor one word backward.
Ctrl + SpaceStart the text selection at the current point.
Ctrl + WCopy the selected text to the paste buffer.
QSwitch the current window back to a regular tmux session.
Ctrl + B, then ]Paste the contents of the last buffer to the current window.
Ctrl + B, then =Open the list of currently active sessions and select where to paste the current selection.

Image credit: Unsplash

Subscribe to our newsletter!

Our latest tutorials delivered straight to your inbox

Ramces Red
Ramces Red - Staff Writer

Ramces is a technology writer that lived with computers all his life. A prolific reader and a student of Anthropology, he is an eccentric character that writes articles about Linux and anything *nix.