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.
Ctrl-b, let go, then d (detach). Typing exit would close the session instead.tmux ls lists sessions; tmux attach joins the most recent one.Numbered sessions get confusing fast. Name them after what they're for, and keep one per project.
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.
One tmux server holds as many sessions as you like, each with a name (or a number if you didn't give one). Most tmux commands take -t for target: which session (or window, or pane) to act on.
You don't have to type the whole name: tmux accepts any unique start of it, so tmux attach -t wo finds work. Use the full name in scripts, where a new session starting with the same letters would make it ambiguous.
tmux new -s work
The status bar now shows [work] on the left.
Detach (Ctrl-b d), then start a second session without attaching to it, using -d:
tmux new -s scratch -d
tmux ls
tmux rename-session -t scratch ideas
Inside a session, Ctrl-b $ does the same for the current one.
Attach to work, then hop to the next session with Ctrl-b ). (Ctrl-b ( goes back; Ctrl-b s shows a list to pick from.)
tmux attach -t work
Finish in the ideas session.
From inside ideas, close work:
tmux kill-session -t work
tmux ls
tmux new -s name starts a named session; -d starts it in the background.tmux attach -t name joins a specific session.Ctrl-b ) and Ctrl-b ( switch sessions; Ctrl-b s lists them.tmux rename-session and tmux kill-session rename and close.