Terminal sessions with tmux
You run several jobs from one terminal with sessions that survive a dropped connection, split panes and windows.
Level 101 · 14 lessons · 12 practice labs
Lessons
Sessions
- Why tmux: work that survives a dropped connection
- Creating, detaching and re-attaching sessions
- The prefix key and basic shortcuts
- Naming sessions and switching between them
- Short task: start a long job, detach and collect the result later
Windows and panes
- Windows: creating, naming and moving between them
- Panes: splitting, resizing, zooming
- Copy mode: scrolling back and grabbing text
- Synchronising panes: typing one command into many
- Short task: build a monitoring layout for logs, processes and disk
Customisation
- tmux.conf: prefix, mouse and the status bar
- The same job with screen on older servers
- Shared sessions: working on the same screen as a colleague
- Capstone: run a maintenance window in a tmux session that survives disconnects
Practice labs
- Start a long job in tmux and collect it later: Start a long compression job in a named tmux session, detach, then reattach when it finishes and save the result.
- Clean up forgotten tmux sessions: List the tmux sessions left open on the server, keep the ones still working and close the idle ones.
- Find and take over a job left by a dropped connection: Find a colleague's half-finished update in their tmux session after their connection dropped, attach and finish it.
- Build a monitoring layout for logs, processes and disk: Create three panes in one window for the log stream, process list and disk usage and name the layout.
- Recover scrolled-away output with copy mode: Find error output long scrolled off screen in copy mode, select it and paste it into a file.
- Run the same command on four servers at once: Synchronise four panes to run the same check on all of them, then switch sync off and inspect the odd one out.
- Set the prefix key and mouse in tmux.conf: Write a tmux.conf that changes the prefix key, enables the mouse and shows the host name in the status bar.
- Fix a tmux config that will not load: Find the outdated options in a tmux config that errors at startup and replace them with current equivalents.
- Do the same job with screen on an old server: On a server without tmux, open a named screen session, create two windows, detach and reattach.
- Share a session with a colleague: Set up a shared tmux session a second user can attach to read-only and verify its permissions.
- Run a maintenance window that survives drops: Run the update, restart and verification steps in separate tmux windows and carry on after a dropped connection.
- Script a ready-made work layout: Write a tmux start-up script that opens windows, panes and the commands inside them with one command.
About this course
You run several jobs from one terminal with sessions that survive a dropped connection, split panes and windows.
What you will learn
- Sessions
- Windows and panes
- Customisation
Prerequisites
No prior knowledge is needed; the course starts from zero.
Lab environment
Lessons run in your own Kali Linux terminal that opens in the browser. Nothing to install; the lab starts clean in every lesson.
Frequently asked questions
- Is this course right for my level?
- The course is at beginner level; every term is explained where it first appears.
- Is there anything to install?
- No. Every lesson runs in your own lab environment that opens in the browser.
- How do lessons work?
- Each lesson has 8 to 10 steps and a short quiz. Early steps show the command to type, later steps give less help; if two attempts fail, the solution opens.
- Can I try it for free?
- Yes. The first three lessons of every course are free.