Guide to TMux

Installation

Fortunately installing tmux is pretty straightforward on most distributions a simple sudo apt-get install tmux (Ubuntu and derivatives) or brew install tmux (Mac) should be sufficient.

Starting the First Session

For the first session, just start with

$ tmux

Prefix Key

All commands in tmux are triggered by a prefix key followed by a command key (quite similar to emacs). By default, tmux uses C-b as prefix key, which simply means press the Ctrl and b keys at the same time.

Shortcuts

Function Shortcut
Split Horizontally C-b %
Split Vertically C-b "
Navigating Panes C-b <arrow key>
Closing Panes C-d
New Window C-b c
Previous Window C-b p
Next Window C-b n
To Window number C-b <number>
Detach Session C-b d
Help C-b ?
Toggle Full C-b z
Rename Current Window C-b ,
Scrolling Up/Down C-b fn-<arrow up/down>
Mark/Unmark Current Pane C-b M

CLI

List all running sessions

$ tmux ls

Attach to a tmux session

$ tmux attach -t <session_name>

Create new tmux session with a name

$ tmux new -s <session_name>

Rename a session

$ tmux rename-session -t <old_session_name> <new_session_name>

Reference