tmux Cheat Sheet
A searchable tmux cheat sheet: creating, detaching and reattaching sessions, windows, splitting and moving between panes, scroll mode, synchronised panes and useful config lines.
Free · No sign-up · Your inputs stay in your browser
Reference
tmux cheat sheet
| Keys or command | Does |
|---|---|
| tmux new -s deploy | New named session |
| tmux ls | List sessions |
| tmux attach -t deploy | Reattach to a session (a for short) |
| tmux kill-session -t deploy | End a session |
| Ctrl-b d | Detach: the session keeps running after you disconnect |
| Ctrl-b c | New window |
| Ctrl-b n / p | Next / previous window |
| Ctrl-b 0-9 | Go to window by number |
| Ctrl-b , | Rename window |
| Ctrl-b w | Pick a window from a list |
| Ctrl-b % | Split side by side |
| Ctrl-b " | Split top and bottom |
| Ctrl-b arrow | Move between panes |
| Ctrl-b z | Zoom a pane to full size and back |
| Ctrl-b x | Close the pane |
| Ctrl-b Space | Cycle pane layouts |
| Ctrl-b [ | Scroll mode (q to leave); search with / in vi mode |
| Ctrl-b :setw synchronize-panes on | Type into every pane at once |
| Ctrl-b s | Switch between sessions |
| Ctrl-b $ | Rename session |
| Ctrl-b ? | List all key bindings |
| set -g mouse on | ~/.tmux.conf: click, resize and scroll with the mouse |
| set -g history-limit 50000 | ~/.tmux.conf: longer scrollback |
| setw -g mode-keys vi | ~/.tmux.conf: vi keys in scroll mode |
| tmux source-file ~/.tmux.conf | Reload the config |
Ctrl-b is the default prefix: press it, release, then the key. The point of tmux on a server is that a session survives a dropped SSH connection, so a long migration or backup started inside one keeps running. Many people rebind the prefix to Ctrl-a in ~/.tmux.conf.
About this tool
Method, assumptions, practical next steps, and limits.
Why use it on a server
A tmux session keeps running when the SSH connection drops. A database migration, a long backup or a big rsync started inside tmux survives a laptop going to sleep, and you reattach with tmux attach. Panes put a log tail next to the command you are running. The tmux wiki has the full reference.
The prefix
Every binding starts with the prefix key: press Ctrl-b, release, then the key. Many people rebind it to Ctrl-a in ~/.tmux.conf; GNU screen users find that familiar.