Beginner · 7 min · practise every command in the built-in terminal

tmux — Terminal Multiplexer

tmux lets you run multiple terminal sessions inside one window, and keep them running even after you disconnect. Essential for working on remote servers over SSH.

Why use tmux?

  • Start a long-running task, disconnect, reconnect later — it's still running
  • Split one terminal into multiple panes
  • Keep several projects organized in named sessions

Start a new session

tmux                          # Unnamed session
tmux new -s work              # Named session "work"

List sessions

tmux ls
tmux list-sessions

Attach to an existing session

tmux attach -t work
tmux a -t work                # Short form

Kill a session

tmux kill-session -t work

The prefix key

Almost every tmux shortcut starts with a prefix, by default Ctrl+b. You press Ctrl+b, release, then press the next key.

Practice tasks

  1. Start a new named tmux session called 'work'
  2. List all active tmux sessions
  3. Attach to the work session
  4. Kill the work session when you're done with it

Commands in this lesson

tmux & Screen