Skip to main content

Quick Reference

tmux Cheat Sheet

The essential shortcuts every sysadmin and developer needs. No need to memorize the entire manual. Bookmark this page instead.

10

Categories

100

Commands

6

Pro Workflows

1

Sessions

Creating & Attaching

tmuxStart a new, unnamed session
tmux new -s nameStart a new session with a name
tmux new -s name -n winStart a named session with a named first window
tmux attach -t nameAttach to an existing session by name
tmux a -t nameSame, shorthand for attach
tmux lsList every running session

Managing Sessions

C-b dDetach from the current session (it keeps running)
C-b $Rename the current session
C-b sShow an interactive list of sessions to switch to
C-b (Switch to the previous session
C-b )Switch to the next session
tmux kill-session -t nameKill a specific session by name
tmux kill-serverKill the tmux server and every session on it
2

Windows

Creating & Closing

C-b cCreate a new window
C-b &Close the current window (asks to confirm)
C-b ,Rename the current window
tmux new-window -n nameCreate a named window from a script or shell

Navigating Windows

C-b 0-9Jump directly to window by number
C-b nGo to the next window
C-b pGo to the previous window
C-b lGo to the last (previously selected) window
C-b wShow an interactive list of windows
C-b .Move the current window to a different index
3

Panes

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 window
C-b {Swap the current pane with the previous one
C-b }Swap the current pane with the next one

Closing & Info

C-b xClose the current pane (asks to confirm)
Ctrl+dClose a pane by exiting its shell
C-b qBriefly display pane numbers
C-b tShow a clock in the current pane
5

Copy 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 mode
h j k lMove the cursor left, down, up, right
Ctrl+u / Ctrl+dScroll half a page up / down
g / GJump to the top / bottom of the scrollback

Selecting, Searching & Pasting

SpaceStart a selection
EnterCopy the selection and exit copy mode
/Search forward for a pattern
?Search backward for a pattern
nJump to the next search match
C-b ]Paste the most recently copied text
6

Resizing

Keyboard Resize

C-b C-↑↓←→Resize the pane by one cell (hold to repeat)
C-b M-↑↓←→Resize the pane by five cells

Precise 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 target
7

Configuration

Config File Basics

~/.tmux.confDefault config file, loaded at startup
:source-file ~/.tmux.confReload the config without restarting tmux
set -g mouse onEnable mouse support for panes, resizing, and scroll
set -g history-limit 10000Increase scrollback buffer (default is 2000 lines)

Remapping the Prefix

set -g prefix C-aChange the prefix key to Ctrl+a
unbind C-bRemove the default Ctrl+b prefix binding
bind C-a send-prefixForward Ctrl+a to a nested, inner tmux session
set -sg escape-time 0Remove the delay after pressing Esc (helps vim)
8

Status Bar & Display

Status Bar Basics

set -g status onShow the status bar (on by default)
set -g status offHide the status bar
set -g status-position topMove the status bar to the top of the screen
set -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 bar
set -g status-right "..."Set the right side of the status bar
set -g status-style bg=black,fg=whiteSet the status bar background and text color
setw -g window-status-current-style bg=greenHighlight the active window in the list
9

Scripting & Automation

Sending Commands

tmux send-keys -t name 'cmd' EnterType a command into a target pane and run it
tmux new-session -d -s nameStart a detached session, for scripts and cron jobs
tmux has-session -t nameCheck whether a session exists, by exit code

Automating Layouts

tmux split-window -h -t nameSplit a window from outside tmux
tmux select-layout -t name tiledApply a named layout to a window
tmux source-file file.tmuxLoad and run commands from a tmux script file
10

Pro Workflows

Real-world techniques that separate beginners from power users.

#1

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
#2

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
#3

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
#4

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
#5

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
#6

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
Back to Top

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

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.