Tmux for terminal multiplexing
Terminal multiplexer essentials — the session / window / pane model, and keeping tasks alive after SSH disconnects
tmux is a powerful terminal multiplexer that lets you manage multiple sessions, windows, and panes inside a single terminal — your tasks keep running in the background even after SSH disconnects.
Key capabilities:
- Session management: create, detach from, and reattach to different tmux sessions. Sessions keep running in the background after SSH disconnects, so you can pick up where you left off.
- Windows and panes: each session can hold multiple windows, and each window can be split into multiple panes — driving several programs from a single screen.
- Persistence: ideal for long-running tasks (data-processing scripts, server monitoring, etc.); reattach from any device to continue.
- Collaboration: multiple users can share the same session in real time, which is great for teamwork.
- Keyboard shortcuts: most actions are triggered with the prefix key
Ctrl+b. - Configurable: customize keybindings, layouts, and appearance through
~/.tmux.conf.
Installation
Debian / Ubuntu
apt-get update -y
apt-get install tmuxRHEL / CentOS
yum update -y
yum install tmuxCommon commands
Session management
| Action | Command |
|---|---|
| Create an unnamed session | tmux |
| Create a named session | tmux new -s session_name |
| List all sessions | tmux ls |
| Reattach to the default session | tmux attach |
| Reattach to a specific session | tmux attach -t session_name |
| Rename a session | tmux rename-session -t old_name new_name |
| Kill a session | tmux kill-session -t session_name |
| Detach from the current session | tmux detach or Ctrl+b d |
After detaching, you can close the terminal window and the session keeps running in the background.
Window management
| Action | Command |
|---|---|
| Create a new window | tmux new-window or Ctrl+b c |
| List all windows | Ctrl+b w |
| Rename a window | Ctrl+b , then type a name and press Enter |
| Switch to a window by index | Ctrl+b <number> |
| Switch to the previous window | Ctrl+b p |
| Switch to the next window | Ctrl+b n |
| Close a window | exit or Ctrl+d |
Pane operations
| Action | Command |
|---|---|
| Split horizontally (top/bottom) | Ctrl+b " |
| Split vertically (left/right) | Ctrl+b % |
| Move the cursor between panes | Ctrl+b <arrow> |
| Cycle the cursor through panes | Ctrl+b o |
| Close the current pane | exit |
Further reading
For more on tmux, see the tmux handbook.
Last updated on
Linux cheat sheet for GPU pods
~40 commands you actually use after SSH-ing into a pod — files / permissions / archives / SCP / nvidia-smi GPU triage / killing processes
Accelerate model downloads (Hugging Face mirror)
Set HF_ENDPOINT inside a pod to use the internal Beijing-1/2/3/4 mirror — three approaches with snapshot_download, huggingface-cli, and from_pretrained
