Skip to main content
This lesson covers tmux fundamentals: what tmux is, how to start it, and how to work with sessions, windows, panes, copy/paste, and basic configuration. tmux (first released in 2007) is a modern terminal multiplexer similar to GNU Screen but with several enhancements:
  • Client–server model: a single server manages multiple sessions; each session contains windows, and windows can be shared between clients.
  • Interactive menus for selecting sessions, windows, and clients.
  • The same window can be linked to multiple sessions.
  • Supports both Vim and GNU Emacs key layouts.
  • Full UTF-8 and 256-color terminal support.
A dark-themed slide titled "tmux" listing features like "Released in 2007,"
client-server model with shared windows, interactive session/window selection,
linking the same window to multiple sessions, vim and Emacs key layouts, and
UTF-8/256-color terminal support. The KodeKloud logo appears in the
top-right.
Getting started
  • Start tmux from your shell:
This opens a shell inside tmux and shows a status bar along the bottom of the terminal. The default command prefix (leader key) is Ctrl+b (referred to below as “prefix”). Status bar contents
  • Session name
  • Window index (tmux counts windows from 0)
  • Window name (by default tmux shows the running program name and updates it automatically)
  • An asterisk (*) indicates the currently visible window
  • Host name, time, date, etc.
Example: start tmux and create a named session and window
Windows Windows are top-level workspaces inside a session. Each window can contain multiple panes. Common window operations Quick reference (text)
Panes (splitting windows) Panes are subdivisions of a window; each pane is a full pseudo-terminal. Basic pane operations Quick reference (text)
Sessions A session is a collection of windows. Sessions allow you to organize work and attach/detach clients. Session commands Examples
Be careful: killing a pane, window, or session terminates processes running inside it. Save work before confirming any kill operation.
Copy / paste and scrollback tmux provides its own copy/scrollback mode that allows selecting text, copying to an internal buffer, and pasting between panes. Steps to copy and paste
  1. Enter copy/scrollback mode: prefix + [
  2. Navigate with arrow keys, PageUp/PageDown, or vi-style keys (if configured).
  3. Start selection with Space.
  4. Move to the end of selection.
  5. Copy selection with Enter (puts it into tmux buffer).
  6. Paste into the current pane with: prefix + ]
Manage buffers from shell
Configuration
  • System-wide config: /etc/tmux.conf
  • Per-user config: ~/.tmux.conf
  • Start tmux with an alternate config file: tmux -f /path/to/config
Common ~/.tmux.conf examples Change prefix to Ctrl+a and unbind default Ctrl+b:
Bind keys to select windows beyond 9 (example: Alt-0..Alt-2 → windows 10..12)
Note: tmux has a rich set of options and bindings — consult the manual or use the built-in command prompt (prefix + :) to explore commands.
Tip: For the complete list of commands and detailed options, read the manual: man tmux
Links and references That covers the essentials: starting tmux, working with sessions, windows, and panes, using the copy/paste buffer, and adding simple configuration. Use the tables and command summaries above as a quick reference while you practice.

Watch Video