tmux is one of those tools that quietly becomes indispensable.
If you:
- work over SSH
- manage multiple shells
- run long-lived processes
- juggle several environments at once
then tmux is less a convenience and more a survival tool.
This cheatsheet focuses on high-signal commands you’ll use repeatedly, not exhaustive coverage.
- Session: a collection of windows
- Window: similar to a terminal tab
- Pane: a split within a window
- Prefix key: default is
Ctrl-b
Almost all commands start with the prefix.
Create a new session:
tmux new -s mysessionList sessions:
tmux lsAttach to a session:
tmux attach -t mysessionDetach from session:
Ctrl-b dRename the current session:
Ctrl-b $Sessions are what make tmux powerful over unreliable connections.
Create a new window:
Ctrl-b cList windows:
Ctrl-b wRename current window:
Ctrl-b ,Switch to window by number:
Ctrl-b 0
Ctrl-b 1Windows are best used to separate tasks, not layouts.
Split horizontally:
Ctrl-b "Split vertically:
Ctrl-b %Move between panes:
Ctrl-b ← ↑ → ↓Resize panes:
Ctrl-b Ctrl-←
Ctrl-b Ctrl-→
Ctrl-b Ctrl-↑
Ctrl-b Ctrl-↓Close the current pane:
Ctrl-b xPanes are ideal for contextual work, not permanent separation.
Enter copy mode:
Ctrl-b [Navigate using:
- arrow keys
- Page Up / Page Down
- Vim-style keys (if configured)
Start selection:
SpaceCopy selection:
EnterPaste buffer:
Ctrl-b ]Copy mode is essential when reviewing logs or command output.
Inside copy mode:
/Then type your search string and press Enter.
Repeat search:
nSearching output beats rerunning commands—especially in production.
Swap panes:
Ctrl-b {
Ctrl-b }Break pane into a new window:
Ctrl-b !Kill the current window:
Ctrl-b &Reorganizing layouts quickly is one of tmux’s biggest strengths.
Show time:
Ctrl-b tDisplay pane numbers:
Ctrl-b qReload tmux config:
Ctrl-b :source-file ~/.tmux.confUseful when iterating on configuration.
A common pattern:
- start tmux on the remote host
- attach once
- leave it running indefinitely
If your connection drops:
- reconnect
- reattach
- everything is still there
This alone justifies tmux for many engineers.
- Keep sessions named by purpose, not host
- Don’t overload a single window with too many panes
- Use tmux to preserve context, not just shells
- Learn a few commands deeply rather than many shallowly
Muscle memory matters more than completeness.
- tmux is a session manager, not just a splitter
- Sessions protect work across disconnections
- Windows organize tasks; panes provide context
- Copy mode is essential for real-world use
- A small command set goes a long way
Once tmux becomes part of your workflow, working without it feels unnecessarily fragile.