Tool cheatsheet
tmux 3 Cheatsheet
Sessions, windows and panes in tmux, with the default Ctrl-b prefix, copy mode and configuration.
Sessions
- Start a named session — Create a new session called work.
- List sessions — Show the running sessions.
- Attach to a session — Reconnect to a running session.
- Detach from the session — Leave tmux running in the background. Press the prefix, then d.
- Switch sessions — Choose a session from an interactive list.
- Rename the session — Change the current session's name.
- Run a command in a background session — Start a session that runs a command without attaching to it.
- Kill a session — End a session and everything running in it.
- Kill all sessions — Stop the tmux server and every session.
Windows
- Create a window — Open a new window in the current session.
- Next or previous window — Move to the next or previous window.
- Go to a window by number — Jump straight to window number 2.
- Choose a window from a list — Show all windows and pick one.
- Rename the window — Change the current window's name.
- Close the window — Kill the current window after confirmation.
Panes
- Split side by side — Split the pane into left and right panes.
- Split top and bottom — Split the pane into upper and lower panes.
- Move between panes — Move to the pane in a direction using the arrow keys, or to the next pane with o.
- Zoom a pane — Toggle the current pane between full window and its normal size.
- Resize a pane — Resize towards a direction. Hold Ctrl after the prefix to resize in larger steps.
- Rearrange panes — Cycle through the preset layouts.
- Close the pane — Kill the current pane after confirmation.
- Break a pane into its own window — Move the current pane into a new window.
Copy mode and scrolling
- Scroll back through output — Enter copy mode to scroll with the arrow keys or Page Up. Press q to leave.
- Search the scrollback — In copy mode, search backward with ? or forward with /.
- Paste the copied text — Paste the most recent tmux buffer.
- Use vi keys in copy mode — Set the copy-mode key bindings to vi style in ~/.tmux.conf.
Commands and configuration
- Open the command prompt — Type any tmux command, such as new-window.
- Send keys to another pane — Type a command into a session's pane from a script.
- Show all key bindings — Show the key bindings in a searchable list.
- Reload the configuration — Apply changes to ~/.tmux.conf without restarting tmux.
- Turn on mouse support — Click to select panes and windows, drag borders and scroll. Add it to ~/.tmux.conf.
- Change the prefix to Ctrl-a — Replace the default prefix in ~/.tmux.conf.
- Number windows from 1 — Start window and pane numbering at 1 so the keys match the keyboard row.
Related cheatsheets
- Ansible 2 cheatsheet — Run ad-hoc commands and playbooks, manage inventories, roles, collections and secrets with Ansible.
- Argo CD 3 cheatsheet — Install Argo CD, define Applications declaratively, and manage sync, diffs, history and rollbacks with the argocd CLI.
- AWS CLI 2 cheatsheet — Configure credentials and manage S3, EC2, Lambda, logs, containers and secrets with the AWS CLI v2.
- Azure CLI 2 cheatsheet — Sign in and manage resource groups, VMs, web apps, storage, Kubernetes, registries and secrets with the az command.
- Bash and Linux 5 cheatsheet — Everyday shell and Linux commands for files, searching text, permissions, processes and servers.
- Claude API cheatsheet — Call Claude from Python, TypeScript or curl: messages, streaming, thinking, tools, structured output, caching, batches and error handling.