Docs / Linux Basics / How to Use tmux for Terminal Multiplexing

How to Use tmux for Terminal Multiplexing

By Admin · Feb 25, 2026 · Updated Apr 23, 2026 · 228 views · 1 min read

What Is tmux?

tmux is a terminal multiplexer — it lets you run multiple terminal sessions inside one window, detach and reattach sessions, and keep processes running after disconnecting from SSH.

Installation

sudo apt install -y tmux    # Ubuntu/Debian
sudo dnf install -y tmux    # Rocky/Alma Linux

Essential Commands

# Start a new session
tmux

# Start a named session
tmux new -s myproject

# Detach from session (keeps it running)
# Press: Ctrl+b, then d

# List sessions
tmux ls

# Reattach to a session
tmux attach -t myproject

# Kill a session
tmux kill-session -t myproject

Window Management

All commands start with the prefix Ctrl+b:

KeyAction
Ctrl+b cCreate new window
Ctrl+b nNext window
Ctrl+b pPrevious window
Ctrl+b 0-9Switch to window by number
Ctrl+b ,Rename current window
Ctrl+b &Close current window

Pane Splitting

KeyAction
Ctrl+b %Split vertically
Ctrl+b "Split horizontally
Ctrl+b arrowNavigate between panes
Ctrl+b zToggle pane zoom (fullscreen)
Ctrl+b xClose current pane

Why Use tmux on a VPS?

  • Persistent sessions — processes survive SSH disconnects
  • Multi-tasking — monitor logs while editing files
  • Long-running tasks — start a build and detach safely
  • Pair programming — multiple users can attach to the same session

Was this article helpful?