Tmux - terminal multiplexer cheat sheet

The following is a short list of the most common keybindings for the tmux terminal multiplexer.

Starting tmux

CommandDescription
tmuxStart a new session
tmux new -s nameStart a new session with a name
tmux aAttach to the last session
tmux a -t nameAttach to a named session
tmux lsList sessions

Session Management

CommandDescription
C-b dDetach from the current session
C-b $Rename the current session
C-b sList sessions (navigate with arrow keys)

Windows (Tabs)

CommandDescription
C-b cCreate a new window
C-b ,Rename the current window
C-b wList windows
C-b nNext window
C-b pPrevious window
C-b 0 to 9Go to window number 0-9
C-b &Close the current window

Panes (Splits)

CommandDescription
C-b %Vertical split
C-b "Horizontal split
C-b oSwitch to the next pane
C-b ;Toggle to the last pane
C-b xClose the current pane
C-b [Space]Toggle pane layouts
C-b q followed by a numberQuickly select a pane by number
C-b { or C-b }Swap panes

Misc Commands

CommandDescription
C-b tShow the time
C-b ?List all keybindings
C-b zZoom in/out on a pane
C-b [ and C-b ]Enter/Exit copy mode
C-b :Enter command mode

Configuration

~/.tmux.conf is the configuration file for tmux. You can customize settings and keybindings there.

You can see my tmux configuration in my dotfiles


Note: C-b is the default prefix key for tmux, but you can change it in the .tmux.conf configuration file. I prefer to use C-s


** If you want to check what else I'm currently doing, be sure to follow me on twitter @rderik or subscribe to the newsletter. If you want to send me a direct message, you can send it to derik@rderik.com.