Quick Reference
tmux Cheat Sheet
The essential shortcuts every sysadmin and developer needs. No need to memorize the entire manual. Bookmark this page instead.
Categories
Commands
Pro Workflows
Sessions
Creating & Attaching
tmuxStart a new, unnamed sessiontmux new -s nameStart a new session with a nametmux new -s name -n winStart a named session with a named first windowtmux attach -t nameAttach to an existing session by nametmux a -t nameSame, shorthand for attachtmux lsList every running sessionManaging Sessions
C-b dDetach from the current session (it keeps running)C-b $Rename the current sessionC-b sShow an interactive list of sessions to switch toC-b (Switch to the previous sessionC-b )Switch to the next sessiontmux kill-session -t nameKill a specific session by nametmux kill-serverKill the tmux server and every session on itWindows
Creating & Closing
C-b cCreate a new windowC-b &Close the current window (asks to confirm)C-b ,Rename the current windowtmux new-window -n nameCreate a named window from a script or shellNavigating Windows
C-b 0-9Jump directly to window by numberC-b nGo to the next windowC-b pGo to the previous windowC-b lGo to the last (previously selected) windowC-b wShow an interactive list of windowsC-b .Move the current window to a different indexPanes
Splitting
C-b %Split the pane vertically (side by side)C-b "Split the pane horizontally (stacked)C-b !Break the current pane out into its own windowC-b {Swap the current pane with the previous oneC-b }Swap the current pane with the next oneClosing & Info
C-b xClose the current pane (asks to confirm)Ctrl+dClose a pane by exiting its shellC-b qBriefly display pane numbersC-b tShow a clock in the current paneCopy Mode & Scrollback
tmux ships with Emacs-style copy mode keys by default. The bindings below assume the vi-style key table (set -g mode-keys vi in your config, covered under Configuration), which is what most sysadmins coming from vim actually run.
Entering & Moving
C-b [Enter copy mode (also how you scroll back)qExit copy modeh j k lMove the cursor left, down, up, rightCtrl+u / Ctrl+dScroll half a page up / downg / GJump to the top / bottom of the scrollbackSelecting, Searching & Pasting
SpaceStart a selectionEnterCopy the selection and exit copy mode/Search forward for a pattern?Search backward for a patternnJump to the next search matchC-b ]Paste the most recently copied textResizing
Keyboard Resize
C-b C-↑↓←→Resize the pane by one cell (hold to repeat)C-b M-↑↓←→Resize the pane by five cellsPrecise Resize
:resize-pane -x 80Set the pane width to 80 columns:resize-pane -y 20Set the pane height to 20 rows:resize-pane -t 2 -D 10Resize pane 2 downward by 10 cells, by targetConfiguration
Config File Basics
~/.tmux.confDefault config file, loaded at startup:source-file ~/.tmux.confReload the config without restarting tmuxset -g mouse onEnable mouse support for panes, resizing, and scrollset -g history-limit 10000Increase scrollback buffer (default is 2000 lines)Remapping the Prefix
set -g prefix C-aChange the prefix key to Ctrl+aunbind C-bRemove the default Ctrl+b prefix bindingbind C-a send-prefixForward Ctrl+a to a nested, inner tmux sessionset -sg escape-time 0Remove the delay after pressing Esc (helps vim)Status Bar & Display
Status Bar Basics
set -g status onShow the status bar (on by default)set -g status offHide the status barset -g status-position topMove the status bar to the top of the screenset -g status-interval 5Refresh the status bar every 5 seconds (default is 15)Customizing Content
set -g status-left "..."Set the left side of the status barset -g status-right "..."Set the right side of the status barset -g status-style bg=black,fg=whiteSet the status bar background and text colorsetw -g window-status-current-style bg=greenHighlight the active window in the listScripting & Automation
Sending Commands
tmux send-keys -t name 'cmd' EnterType a command into a target pane and run ittmux new-session -d -s nameStart a detached session, for scripts and cron jobstmux has-session -t nameCheck whether a session exists, by exit codeAutomating Layouts
tmux split-window -h -t nameSplit a window from outside tmuxtmux select-layout -t name tiledApply a named layout to a windowtmux source-file file.tmuxLoad and run commands from a tmux script filePro Workflows
Real-world techniques that separate beginners from power users.
Persistent Remote Sessions
Start work over SSH, and it survives a dropped connection or a closed laptop lid.
tmux new -s work
tmux attach -t work
Detach, Reattach, Repeat
Step away from a long-running job without killing it, then pick it up exactly where you left it.
C-b d detach, keeps running
tmux attach -t work resume
Zoom In on One Pane
Blow a single pane up to full screen to read a long log, then shrink it back to the layout you had.
C-b % split the window
C-b z zoom / unzoom
Broadcast Keystrokes
Type once, and it lands in every pane in the window. Handy for patching several servers at once. Turn it off the same way, with "off" in place of "on".
C-b : open the command prompt
setw synchronize-panes on
Name Everything
Numbered windows and sessions are unreadable past three of them. Naming them costs two keystrokes.
C-b $ rename session
C-b , rename window
Reload Config Live
Edit .tmux.conf and every open session picks up the change immediately. No need to kill and restart.
C-b : open the command prompt
source-file ~/.tmux.conf
Running Linux in Production?
Bullium helps IT teams standardize tooling, automate patching, and find misconfigurations before they become incidents. Managed IT Services →
Already have the infrastructure sorted? Run netvuln-tool, an open-source network vulnerability scanner, to validate your exposure.
Related Reading
- Prefer a modal-editing workflow at the keyboard? Vim Cheat Sheet
- Setting up or hardening a Linux server? Linux server administration for SMBs
- Automating your Linux config across many machines? Ansible automation for SMB infrastructure
- Want a sandbox to practice on? Build a Proxmox home lab
Managing Linux infrastructure at scale?
Bullium Consulting works with sysadmins and IT teams to standardize Linux environments, automate operations, and keep infrastructure secure. Whether you need ongoing managed support or a one-time security assessment, we have done this in production.