202603240856-tmux-common-shortcuts
๐ฏ List Overview
This card is a practical working list of the tmux shortcuts and commands that matter most in daily use. It is intentionally biased toward actions that reduce friction when working inside long-lived terminal sessions: creating and attaching sessions, moving between windows and panes, splitting layouts, entering copy mode, and recovering from accidental detach or pane clutter. The goal is not to be exhaustive. It is to capture the small, reusable subset that covers most real workflows.
The default tmux prefix is Ctrl-b, written here as prefix. So prefix c means press Ctrl-b, release it, then press c. The command-line examples are included because tmux becomes much easier once the mental model is clear: sessions contain windows, and windows contain panes. In practice, the shortcuts are faster for interactive work, while the commands are useful in scripts, SSH login flows, and when attaching to an existing workspace from a fresh shell.
๐งพ Items
-
Basic mental model
- Session: the top-level workspace. A session can stay alive after you disconnect from SSH or close a terminal.
- Window: a tab inside a session.
- Pane: a split terminal inside a window.
- Prefix: the leader key that tells tmux the next key is a tmux command. By default it is
Ctrl-b.
-
Start and attach
tmux- Start a new unnamed session quickly.
tmux new -s work- Start a new named session called
work. Naming sessions is worth it because it makes reattaching and switching much easier.
- Start a new named session called
tmux ls- List existing sessions.
tmux a- Attach to the most recently used session.
tmux a -t work- Attach to a specific named session.
tmux kill-session -t work- Kill a session you no longer need.
-
Detach and session navigation
prefix d- Detach from the current session without killing it. This is one of the most important tmux actions because it lets long-running work survive terminal closes or SSH disconnects.
prefix s- Show the session list and choose interactively.
prefix $- Rename the current session.
tmux rename-session -t old new- Rename a session from the command line.
-
Window management
prefix c- Create a new window.
prefix n- Move to the next window.
prefix p- Move to the previous window.
prefix 0throughprefix 9- Jump directly to a numbered window.
prefix ,- Rename the current window.
prefix w- Open the interactive window list.
prefix &- Kill the current window.
tmux new-window -t work- Create a new window inside a target session.
-
Pane splitting and movement
prefix %- Split the current pane vertically, creating left and right panes.
prefix "- Split the current pane horizontally, creating top and bottom panes.
prefix o- Move to the next pane.
prefix ;- Toggle back to the previously active pane.
prefix x- Kill the current pane.
prefix z- Toggle pane zoom. This is especially useful when you usually like a split layout but temporarily want one pane to take the full screen.
prefix q- Briefly show pane numbers, then press the number to jump to a pane.
tmux split-window -h- Split into left and right panes from the command line.
tmux split-window -v- Split into top and bottom panes from the command line.
-
Pane resizing and layout control
prefix Space- Cycle through preset layouts.
prefix Ctrl-o- Rotate panes in the current window.
prefix {- Swap the current pane with the previous pane.
prefix }- Swap the current pane with the next pane.
prefix Alt-Left,prefix Alt-Right,prefix Alt-Up,prefix Alt-Down- Resize the current pane in small steps on many default tmux setups. This is convenient, but exact behavior can depend on terminal and config.
tmux select-layout tiled- Rearrange panes into a tiled layout from the command line.
-
Copy mode and scrolling
prefix [- Enter copy mode. This is the main way to scroll through tmux history when the terminal scrollback alone is not enough.
- In copy mode, use arrow keys, Page Up, or Vim-style motion keys if configured.
- The exact movement keys can vary with tmux mode settings, but entering copy mode is the main concept to remember.
q- Exit copy mode.
prefix ]- Paste the most recent tmux buffer.
-
Useful quality-of-life shortcuts
prefix ?- Show all key bindings.
prefix :- Open the tmux command prompt and run a command interactively.
prefix t- Show a clock. Not essential, but memorable and a good reminder that tmux has many built-in commands behind the prefix layer.
-
Command-line shortcuts worth remembering
tmux has-session -t work- Check whether a session exists. This is very useful in shell scripts.
tmux new -As work- A high-value command for daily use. It creates the
worksession if it does not exist, otherwise it attaches to it. This is often the cleanest single command for a stable personal workspace.
- A high-value command for daily use. It creates the
tmux kill-server- Kill the entire tmux server and all sessions. Powerful, but destructive; use only when you intentionally want a full reset.
-
A minimal daily workflow
- First login:
tmux new -As work- Create or attach to one stable session.
- Inside tmux:
prefix c- Create windows for major tasks such as editor, server, logs, and git.
- Need side-by-side work:
prefix %orprefix "- Split a pane for logs, test output, or a second shell.
- Need to leave:
prefix d- Detach and let the session keep running.
- Reconnect later:
tmux a -t work- Resume exactly where you left off.
- First login: