Click the virtual machine below to start practicing
- Setting up virtual machine…
- Preparing lab files…
- Starting terminal services…
This lab machine has stopped
Your progress through the guide is saved. Start a fresh machine to keep practicing.
Click the virtual machine below to start practicing
Your progress through the guide is saved. Start a fresh machine to keep practicing.
From the last lab. Answer in your head, then open to check.
tmux new -s name -d. The -d means detached.Ctrl-b ) (and Ctrl-b ( for the previous one; Ctrl-b s to pick from a list).A session can hold several windows, like tabs. Each window shows in the status bar with its number and name.
Keys are written Ctrl-b then %: press Ctrl+b, let go, then press %. Ctrl-b is tmux's prefix: it tells tmux the next key is for it.
tmux is a tree: server → sessions → windows → panes. A window fills the screen, like a browser tab. Each has an index (its number in the status bar) and a name.
Until you name a window, tmux renames it to whatever program is running in it (bash, vim, top). Once you name it yourself, it keeps your name.
tmux new -s work
The status bar shows 0:bash*: window 0, running bash. The * marks the current window.
Press Ctrl-b c twice. Each press creates a window, so you now have three: 0, 1 and 2.
Jump to a window by number with Ctrl-b 0, Ctrl-b 1, Ctrl-b 2, and name each one. Either press Ctrl-b , and type the name, or run:
tmux rename-window editor
Name window 0 editor, window 1 server and window 2 logs.
Ctrl-b n and Ctrl-b p: next and previous window.Ctrl-b and a number: straight to that window.Ctrl-b w: a list of every window to pick from.Try them, then finish on the server window.
Go to logs (Ctrl-b 2) and type exit. When its last shell ends, the window closes. (Ctrl-b & closes it too, after asking.)
Ctrl-b c creates a window; Ctrl-b , or tmux rename-window names it.Ctrl-b n/p, Ctrl-b + number and Ctrl-b w move between windows.exit or Ctrl-b & closes a window.