tmux lets you run persistent terminal sessions, split panes, and never lose work to disconnections. Here's how to use it.
March 5, 2026 · 6 min · 1131 words · Rob Washington
Table of Contents
SSH into a server, start a long-running process, lose connection, lose everything. tmux solves this by keeping sessions alive independently of your terminal.
# Start new sessiontmux
# Start named sessiontmux new -s myproject
# List sessionstmux ls
# Attach to sessiontmux attach -t myproject
# Attach to last sessiontmux attach
# Start a development sessiontmux new -s dev
# Create layout:# - Window 0: Editor (vim)# - Window 1: Server (running app)# - Window 2: Git/misc# In window 0, split for editor + terminalprefix + " # horizontal split
prefix + % # vertical split in bottom pane
# Create more windows
prefix + c # new window for server
prefix + c # new window for git
# Rename windows
prefix + , # type "editor"
prefix + n # go to next
prefix + , # type "server"
The killer feature: start something, detach, disconnect, reconnect later.
1
2
3
4
5
6
7
8
9
10
11
# Start long tasktmux new -s backup
./run-backup.sh
# Detachprefix + d
# Disconnect SSH, go home, reconnectssh server
tmux attach -t backup
# Your backup is still running!
# Sessionstmux new -s name # New named sessiontmux ls # List sessionstmux attach -t name # Attach to sessiontmux kill-session -t name
# From inside tmuxprefix + d # Detachprefix + s # Session listprefix + c # New windowprefix + n/p # Next/prev windowprefix + % # Vertical splitprefix + " # Horizontal split
prefix + arrows # Navigate panes
prefix + z # Zoom pane
prefix + [ # Copy mode
prefix + ? # Help (all bindings)
tmux transforms how you work with remote servers. Once you’re used to persistent sessions and pane layouts, you’ll wonder how you ever worked without it.
📬 Get the Newsletter
Weekly insights on DevOps, automation, and CLI mastery. No spam, unsubscribe anytime.