📖 Guide

Tmux — Complete Reference

Comprehensive tmux cheat sheet covering sessions, windows, panes, copy mode, configuration, plugins, and common workflows.

68 commands across 9 categories

Session Management

CommandDescription
tmux new -s name
Create a new named session
tmux ls
List all sessions
tmux attach -t name
Attach to a named session
tmux kill-session -t name
Kill a specific session
Ctrl+b d
Detach from current session
Ctrl+b $
Rename current session
tmux kill-server
Kill all sessions and the tmux server
Ctrl+b s
Show session picker (interactive list)
tmux new -s name -d
Create a new session in the background (detached)

Window Management

CommandDescription
Ctrl+b c
Create a new window
Ctrl+b ,
Rename current window
Ctrl+b &
Close current window (with confirmation)
Ctrl+b w
List all windows (interactive picker)
Ctrl+b n
Move to next window
Ctrl+b p
Move to previous window
Ctrl+b 0-9
Switch to window by number
tmux swap-window -t 0
Swap current window with window 0
Ctrl+b f
Find window by name

Pane Management

CommandDescription
Ctrl+b %
Split pane vertically (left/right)
Ctrl+b "
Split pane horizontally (top/bottom)
Ctrl+b x
Close current pane (with confirmation)
Ctrl+b z
Toggle pane zoom (fullscreen)
Ctrl+b {
Move current pane left
Ctrl+b }
Move current pane right
Ctrl+b Space
Cycle through pane layouts
Ctrl+b !
Convert pane into a new window
Ctrl+b q
Show pane numbers, then press number to switch

Copy Mode

CommandDescription
Ctrl+b [
Enter copy mode (scroll/select text)
q
Exit copy mode
Space
Start selection (in copy mode)
Enter
Copy selection and exit copy mode
Ctrl+b ]
Paste copied text
/
Search forward in copy mode
?
Search backward in copy mode
setw -g mode-keys vi
e.g. Add to ~/.tmux.conf for persistent vi bindings
Use vi-style keys in copy mode

Configuration

CommandDescription
Ctrl+b :
Open tmux command prompt
tmux source-file ~/.tmux.conf
Reload tmux configuration
set -g mouse on
Enable mouse support (scrolling, clicking, resizing)
set -g base-index 1
Start window numbering at 1 instead of 0
set -g default-terminal 'screen-256color'
Enable 256-color support
set -g history-limit 10000
Set scrollback buffer size
set -sg escape-time 0
Remove delay after pressing Escape (useful for vim)
bind r source-file ~/.tmux.conf
e.g. Ctrl+b r will reload after adding this
Bind r to reload config

Status Bar

CommandDescription
set -g status on
Enable status bar
set -g status off
Disable status bar
set -g status-position top
Move status bar to top of screen
set -g status-interval 5
Set status bar refresh interval (seconds)
set -g status-style 'bg=black,fg=white'
Set status bar colors
set -g status-right "%H:%M %d-%b-%y"
Customize right side of status bar

Plugins

CommandDescription
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
Install TPM (Tmux Plugin Manager)
set -g @plugin 'tmux-plugins/tpm'
Add TPM to tmux.conf
set -g @plugin 'tmux-plugins/tmux-resurrect'
Add tmux-resurrect (save/restore sessions across restarts)
set -g @plugin 'tmux-plugins/tmux-sensible'
Add tmux-sensible (good default settings)
Ctrl+b I
Install plugins listed in tmux.conf (via TPM)
Ctrl+b U
Update all plugins (via TPM)

Common Workflows

CommandDescription
tmux new -s dev -d && tmux send-keys -t dev 'vim .' Enter
Create a detached session and run a command in it
tmux pipe-pane -o 'cat >> ~/tmux.log'
Log all output from current pane to a file
Ctrl+b : join-pane -t :1
Move current pane to window 1
tmux capture-pane -pS -1000 > output.txt
Capture last 1000 lines of pane output to file
tmux set synchronize-panes on
Send keystrokes to all panes simultaneously
tmux display-message -p '#S:#I.#P'
Print current session:window.pane identifiers

More Guides

🌿
Git Commands
Complete Git command reference — from basics to advanced workflows. Searchable, with examples.
📝
Vim Commands
Complete Vim/Vi command reference — modes, motions, editing, search, and advanced features.
🐳
Docker Commands
Complete Docker & Docker Compose command reference — containers, images, volumes, networks, and orchestration.
🔤
Regex Reference
Complete regular expression reference — syntax, patterns, quantifiers, groups, lookaheads, and common recipes.
🐧
Linux Commands
Complete Linux/Bash command reference — file management, text processing, networking, system admin, and shell scripting.
☸️
Kubernetes Commands
Complete Kubernetes & kubectl command reference — pods, deployments, services, configmaps, and cluster management.
🐍
Python Reference
Complete Python reference — syntax, data structures, string methods, file I/O, comprehensions, and common patterns.
🗃️
SQL Reference
Complete SQL reference — queries, joins, aggregation, subqueries, indexes, and database management.
🌐
Nginx Reference
Complete Nginx configuration reference — server blocks, locations, proxying, SSL, load balancing, and caching.
🔐
SSH Commands
Complete SSH reference — connections, key management, tunneling, config, SCP/SFTP, and security hardening.
👷
Jenkins Reference
Complete Jenkins reference — pipeline syntax, Jenkinsfile, plugins, CLI, agents, and CI/CD patterns.
📨
HTTP Headers Reference
Complete HTTP headers reference — request headers, response headers, caching, security, CORS, and content negotiation. Searchable, with examples.
🐘
PostgreSQL Reference
Comprehensive PostgreSQL reference — from connection basics to advanced features like JSONB, full-text search, window functions, and performance tuning.
Async Patterns Reference
Multi-language async/concurrency patterns — JavaScript, Python, Go, Rust, Java, and universal concurrency patterns.
📡
Protobuf & gRPC Reference
Comprehensive reference for Protocol Buffers (proto3) and gRPC — message definitions, services, streaming, and common patterns.
📚
JS Array Methods
Complete JavaScript Array methods reference — creating, searching, transforming, sorting, iterating, and common patterns. Searchable, with examples.
🌊
Tailwind CSS Reference
Complete Tailwind CSS reference — layout, spacing, typography, colors, responsive design, states, and common patterns. Searchable, with examples.
GraphQL Reference
Complete GraphQL reference — schema definition, types, queries, mutations, directives, fragments, and common patterns. Searchable, with examples.
💻
VS Code Shortcuts
Complete VS Code keyboard shortcuts — editing, navigation, search, multi-cursor, terminal, debug, and more. Searchable, with Cmd/Ctrl notation.
🔲
CSS Grid Reference
Complete CSS Grid reference — container properties, item placement, grid functions, and common layout patterns. Searchable, with examples.
📦
CSS Flexbox Reference
Complete CSS Flexbox reference — container properties, item properties, and common layout patterns. Searchable, with examples.
⚛️
React Hooks Reference
Complete React Hooks reference — useState, useEffect, useContext, custom hooks, and common patterns. Searchable, with examples.
🔷
TypeScript Reference
Complete TypeScript reference — types, interfaces, generics, utility types, and advanced patterns. Searchable, with examples.
☁️
AWS CLI Reference
Complete AWS CLI reference — EC2, S3, IAM, Lambda, ECS, RDS, CloudFormation, and common operations.
🐹
Go Reference
Complete Go (Golang) reference — syntax, types, functions, concurrency, error handling, and common patterns.
💠
PowerShell Reference
Complete PowerShell reference — cmdlets, pipelines, scripting, file operations, remote management, and Active Directory.
💾
Redis Commands
Complete Redis command reference — strings, hashes, lists, sets, sorted sets, pub/sub, transactions, and server management.
🏗️
Terraform Commands
Complete Terraform reference — init, plan, apply, state management, modules, workspaces, and HCL syntax.
⚙️
Ansible Commands
Complete Ansible reference — playbooks, modules, inventory, roles, vault, and ad-hoc commands.
🟨
JavaScript
Complete JavaScript reference — variables, types, operators, strings, arrays, objects, functions, async, DOM, ES6+, and more.
🎨
CSS
Complete CSS reference — selectors, box model, positioning, typography, animations, media queries, custom properties, and more.
📄
HTML
Complete HTML reference — document structure, text content, forms, media, semantic elements, accessibility, and more.
Java
Complete Java reference — data types, strings, collections, OOP, interfaces, exceptions, file I/O, streams, lambdas, and more.
💻
Bash
Complete Bash reference — variables, strings, arrays, conditionals, loops, functions, file tests, I/O redirection, process management, and more.
🦀
Rust
Comprehensive Rust language cheat sheet covering ownership, traits, pattern matching, concurrency, and more.
📝
Markdown
Complete Markdown syntax reference for headings, formatting, links, tables, code blocks, and extensions.
📋
YAML
YAML syntax reference covering scalars, collections, anchors, multi-line strings, and common patterns.
🌐
Curl
Curl command-line reference for HTTP requests, authentication, file transfers, debugging, and common API patterns.
Cron
Cron scheduling reference covering syntax, field values, crontab management, and common schedule patterns.

📖 Free, searchable command reference. Bookmark this page for quick access.