Stop switching apps. Your browser can do it all.
Every tab you open, every copy-paste into ChatGPT, every lost train of thought — that's your browser failing you. Norton Neo fixes it. Built-in AI works directly inside your session. Hover to preview. Search everything from one bar. VPN and ad blocking included, free.
No apps to learn, no forms to fill. Just talk to Catch like any assistant, type it or call and say it out loud. Say it once, consider it done. Meet your admin savior at catchagent.ai.
Welcome to Grind Engineer , your guide to becoming a better engineer!
No fluff. Pure engineering insights.
Your SSH connection drops. The 3 hour database migration you were watching? Gone. The log tail you had running? Dead. The 6 terminal tabs you had arranged perfectly? Start over from scratch.
This happens to every engineer. And it keeps happening until you learn tmux.
TL;DR: tmux is a terminal multiplexer that runs a server in the background, keeping your terminal sessions alive even when you disconnect. This is the complete guide: what it is, why it exists, how to install it on every OS, every command you need, real workflows, pair programming, .tmux.conf configuration, and an honest comparison with every alternative.
What Is a Terminal Multiplexer?
Before tmux, let's understand the problem it solves.
A terminal multiplexer is a program that lets you do 3 things your regular terminal can't:
Run multiple terminal sessions inside a single window (no more 8 tabs)
Split your screen into panes so you see everything at once
Keep processes running even after you close the terminal or lose your connection
tmux Architecture
That third one is the game changer. Without a multiplexer, closing your terminal kills every process running inside it. With one, your processes live on the server, independent of your terminal app.
The word "multiplexer" comes from electronics. A multiplexer takes multiple input signals and combines them into one output channel. A terminal multiplexer does the same: multiple terminal sessions, one window.
Why tmux Exists (The History)
GNU Screen was the original terminal multiplexer, released in 1987. It let you detach from sessions and reattach later. Revolutionary for its time. But Screen's codebase aged badly. Configuration was confusing, the code was hard to extend, and it couldn't do things like split a window into multiple panes easily.
tmux (terminal multiplexer) was created by Nicholas Marriott in 2007 to fix Screen's limitations. The two biggest improvements:
Feature | GNU Screen (1987) | tmux (2007) |
|---|---|---|
Architecture | Single process | Client server model |
Pane splitting | Limited, bolted on later | First class support from day one |
Configuration | Confusing syntax | Clean, readable config file |
Scripting | Basic | Full command line control of everything |
Status bar | Static | Fully customizable |
Multi client | One client per session | Multiple clients can share one session |
Development | Slow, legacy codebase | Active, modern C codebase |
License | GPL | BSD (more permissive) |
The client server architecture is the key difference. When you start tmux, it launches a server process in the background. Your terminal connects to that server as a client. If the client disconnects (you close the terminal, SSH drops, your laptop dies), the server keeps running. All your sessions, windows, panes, and processes survive.
💡 Key Insight: tmux doesn't run inside your terminal. Your terminal connects to tmux as a client. That's why sessions survive disconnections. The server keeps running even when zero clients are attached.
The 4 Core Concepts You Must Know
Everything in tmux is a 4 level hierarchy. If you understand this hierarchy, you understand tmux.
Level | What It Is | Real World Analogy | Can Have Multiple? |
|---|---|---|---|
Server | The background process managing everything | The building itself | One per machine |
Session | A workspace with its own set of windows | A floor in the building | Yes, unlimited |
Window | A full screen view inside a session | A room on that floor | Yes, unlimited per session |
Pane | A split within a window | A desk in that room | Yes, unlimited per window |
Here's what a real engineer's tmux setup looks like:
Session | Window 0 | Window 1 | Window 2 |
|---|---|---|---|
backend | neovim (code editor) | server logs (tail) | database shell (psql) |
frontend | React dev server | Jest tests running | git operations |
deploy | kubectl dashboard | deployment logs | monitoring metrics |
You switch between sessions instantly with Ctrl+b ( and Ctrl+b ). Between windows with Ctrl+b n and Ctrl+b p. Between panes with arrow keys. Zero mouse usage. Zero alt tabbing. Everything is one or two keystrokes away.
Installing tmux on Every OS
macOS (Homebrew):
brew install tmuxIf you don't have Homebrew yet:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install tmuxUbuntu / Debian:
sudo apt update
sudo apt install tmuxFedora / RHEL / CentOS:
sudo dnf install tmuxArch Linux:
sudo pacman -S tmuxWindows (via WSL):
tmux doesn't run natively on Windows. You need WSL (Windows Subsystem for Linux) first.
# Step 1: Install WSL (run in PowerShell as Administrator)
wsl --install
# Step 2: Restart your computer
# Step 3: Open Ubuntu from Start Menu, then:
sudo apt update
sudo apt install tmuxVerify your installation:
tmux -V
# Expected output: tmux 3.4 (or higher)OS | Package Manager | Command | Typical Version |
|---|---|---|---|
macOS | Homebrew |
| 3.4+ |
Ubuntu/Debian | apt |
| 3.3+ |
Fedora/RHEL | dnf |
| 3.3+ |
Arch | pacman |
| 3.4+ |
Windows | WSL + apt |
| 3.3+ |
Understanding the Prefix Key
Before learning any commands, you need to understand how tmux input works. This trips up every beginner.
tmux uses a prefix key system. The default prefix is Ctrl+b. Here's how it works:
Press
Ctrl+b(hold Ctrl, tap b)Release both keys
Press the action key (like
dfor detach)
This is NOT Ctrl+b+d held simultaneously. It's two separate key presses. Ctrl+b, then d. The prefix tells tmux "the next key is a tmux command, not regular typing."
Why a prefix? Because tmux needs to distinguish between "the user is typing in the terminal" and "the user wants to control tmux." The prefix key acts as a signal: everything after it is a tmux instruction.
Common Mistake | What Actually Happens | The Fix |
|---|---|---|
Holding | Nothing, or garbled input | Press |
Pressing | Types "bd" into terminal | Must hold Ctrl while pressing b |
Pressing prefix twice quickly | Sends literal | Wait a beat between prefix and command |
Every Command You Need (Complete Reference)
I'm splitting these into 4 categories. Learn them in this order.
Category 1: Session Management (run these OUTSIDE tmux, in your regular terminal)
Command | What It Does | When You Use It |
|---|---|---|
| Start a new unnamed session | Quick throwaway work |
| Start a named session called "work" | Every time. Always name your sessions. |
| List all running sessions | To see what's running before attaching |
| Attach to session "work" | Reconnecting after a disconnect |
| Attach to the most recent session | When you only have one session |
| Kill session "work" and all its processes | Cleanup when you're done |
| Kill ALL sessions and the tmux server | Nuclear option. Kills everything. |
| Rename a session | Organizing your workspace |
The 5 Workflows Every Beginner Should Practice
Don't try to learn everything at once. Practice these 5 workflows in order. Each one builds on the previous.
Workflow 1: The Persistent Session
The most basic and most important workflow. Start a named session, do work, detach, come back later.
tmux new -s mywork # Start a session
# ... do whatever you need to do ...
# Press Ctrl+b, then d # Detach
tmux attach -t mywork # Come back laterWorkflow 2: The Split Screen
Run two things side by side. Editor on the left, terminal on the right.
tmux new -s coding
# Press Ctrl+b, then % # Split vertically
# Left pane: open your editor
# Right pane: run your server
# Press Ctrl+b, then arrow # Switch between panesWorkflow 3: The Multi Window Project
One session with multiple windows for different concerns.
tmux new -s project
# Window 0: your editor (already here)
# Press Ctrl+b, then c # Create window 1 for server
# Press Ctrl+b, then c # Create window 2 for git
# Press Ctrl+b, then 0 # Jump back to editor
# Press Ctrl+b, then , # Rename current windowWorkflow 4: The Remote Server Workflow
SSH into a server, start tmux, run a long process, disconnect safely.
ssh production-server
tmux new -s deploy
./run-migration.sh
# Ctrl+b, then d # Detach
exit # Leave SSH
# ... hours later ...
ssh production-server
tmux attach -t deploy # Everything is still runningWorkflow 5: The Multi Session Juggle
Running completely separate projects at the same time.
tmux new -s backend # Session for backend work
# Ctrl+b, then d # Detach
tmux new -s frontend # Session for frontend work
# Ctrl+b, then s # Show session picker
# Arrow keys to select, Enter to switchThe SSH Scenario That Changes Everything
This is where tmux goes from "nice to have" to "I can't believe I ever worked without this."
Scenario | Without tmux | With tmux |
|---|---|---|
SSH drops during 3 hour migration | Migration dies. Data might be corrupted. | Migration keeps running. Reattach and check progress. |
Need to check Slack on laptop during deploy | Open new SSH connection. Lose your terminal layout. | Press |
Monitoring 4 services at once | 4 terminal windows, 4 separate SSH connections | 1 window, 4 panes, 1 SSH connection |
Pair programming with a teammate | Screen share over Zoom (laggy, can't both type) | Both SSH in, both run |
Working from coffee shop with flaky WiFi | Every disconnect kills your work | WiFi drops 10 times. You reattach 10 times. Nothing is lost. |
Running overnight batch job | Must keep laptop open all night | Start job in tmux, close laptop, go home. Check results tomorrow. |
Pair Programming With tmux
Two engineers. Same server. Same terminal. Real time. No Zoom. No screen sharing. No "can you see my screen?"
# Engineer 1 starts the session
ssh shared-server
tmux new -s pairing
# Engineer 2 joins the same session
ssh shared-server
tmux attach -t pairingBoth engineers see the same terminal. Both can type. Both can navigate. When Engineer 1 opens a file, Engineer 2 sees it instantly. When Engineer 2 runs a test, Engineer 1 sees the output.
For pairing across different servers (over the internet), use tmate. It's a fork of tmux purpose built for remote pair programming. It generates a shareable SSH URL that anyone can connect to.
# Install tmate
brew install tmate # macOS
sudo apt install tmate # Ubuntu
# Start a tmate session
tmate
# It prints a URL like: ssh [email protected]
# Share that URL with your teammatePairing Method | Latency | Both Can Type | Setup Required | Works Across Networks |
|---|---|---|---|---|
Zoom screen share | High (200ms+) | No (one driver) | Zoom account | Yes |
VS Code Live Share | Medium (100ms) | Yes | Extension install | Yes |
tmux on shared server | Near zero | Yes | SSH access to same server | Same network only |
tmate | Low (50ms) | Yes |
| Yes |
tmux vs Zellij vs GNU Screen (The Full Comparison)
You'll hear about alternatives. Here's every dimension that matters.
Feature | tmux | Zellij | GNU Screen |
|---|---|---|---|
First released | 2007 | 2021 | 1987 |
Written in | C | Rust | C |
Learning curve | Steep (memorize keybindings) | Gentle (on screen hints) | Steep |
Pre installed on servers | Almost always | Rarely | Almost always |
Session persistence | Yes, rock solid | Yes | Yes |
Pane splitting | Horizontal + vertical | Horizontal + vertical + floating | Limited |
Floating panes | No | Yes (pinned since v0.42) | No |
Plugin system | Basic (via TPM) | Rich (WebAssembly based) | None |
Mouse support | Yes (via config) | Yes (built in) | Limited |
Status bar | Fully customizable | Built in with modes | Basic |
Multi client session sharing | Yes, native | Limited | Yes |
Scrollback buffer | Configurable (default 2000 lines) | Configurable | Small default |
Resource usage | Lightest (~2MB RAM) | Heavier (~15MB RAM) | Light (~3MB RAM) |
Community size | Largest | Growing fast | Small, legacy |
Configuration | ~/.tmux.conf | ~/.config/zellij/config.kdl | ~/.screenrc |
Active development | Yes | Yes | Minimal |
When to use tmux: You work on remote servers over SSH. You need something that's installed everywhere. You want battle tested stability. You're comfortable memorizing keybindings.
When to use Zellij: You work locally on your own machine. You want a modern experience. You prefer on screen keybinding hints over memorization. You want floating panes and a plugin ecosystem.
When to use GNU Screen: You're maintaining legacy systems where Screen is the only option. You're on a server where tmux can't be installed. There is no other reason to choose Screen in 2026.
The default keybindings are functional but awkward. Most engineers customize tmux within their first week. Create a file at ~/.tmux.conf:
Common Mistakes Beginners Make
Every tmux beginner hits these. Save yourself the debugging.
Mistake | What Happens | How To Fix |
|---|---|---|
Forgetting to name sessions | End up with "0", "1", "2" and can't remember which is which | Always use |
Nesting tmux (tmux inside tmux) | Prefix key gets intercepted by outer session | Never run |
Not detaching before closing terminal | Nothing bad happens (session survives), but feels scary | Press |
Holding prefix + command simultaneously | Nothing happens or wrong output | Press prefix, RELEASE, then press command key |
Panes too small to work in | Text wraps badly, can't see anything | Use |
Running out of scrollback | Can't scroll up far enough to see old output | Add |
Takeaways
If you SSH into servers for work, tmux is not optional. Every long running process (deploys, migrations, data jobs, server monitoring) should happen inside a tmux session. The first time your SSH drops and your migration is still running, you'll understand why.
Name every session, name every window.
tmux new -s deployinstead oftmux.Ctrl+b ,to rename windows to "logs" and "shell" instead of "0" and "1". Your future self at 2 AM will thank you for knowing which window has the database and which has the deploy script.Spend 10 minutes on .tmux.conf and never touch it again. Copy the config above. Remap the prefix to
Ctrl+a, enable mouse, set intuitive split keys, bump the scrollback. These 7 changes make tmux feel natural instead of hostile. Do it once and forget about it.
→ Find me : Grind Engineer Community ; Youtube ; LinkedIn ; Twitter ; Instagram
That’s it for today, keep learning!
Scortier, Signing Off!


