Quick Start for AI Research
Running long training jobs on remote servers:
1 2 3 4 5 6 7 8 9 10 11
| tmux new -s mysession
python train.py --epochs 100
tmux attach -t mysession
|
Why: Your experiments survive SSH disconnects and network issues.
Installation
1 2 3 4 5
| brew install tmux
sudo apt-get install tmux
|
Key Concepts
- Sessions - Your workspace (survives disconnects)
- Windows - Like browser tabs
- Panes - Split views
- Prefix - All commands start with
Ctrl+b (shown as C-b)
Essential Commands
Sessions
1 2 3 4
| tmux new -s name tmux ls tmux a -t name tmux kill-session -t name
|
Inside tmux:
C-b d - Detach
C-b s - List/switch sessions
Windows
C-b c - Create window
C-b , - Rename window
C-b n - Next window
C-b p - Previous window
C-b 0-9 - Go to window #
Panes
C-b % - Split vertical
C-b " - Split horizontal
C-b ←↑↓→ - Navigate panes
C-b z - Toggle zoom
C-b x - Kill pane
C-b [ - Enter copy mode (scroll with arrows, q to exit)
C-b ] - Paste
Other
C-b ? - Show all keybindings
C-b : - Command mode
Basic Config
Create ~/.tmux.conf:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| set -g mouse on
bind | split-window -h bind - split-window -v
set -g history-limit 10000
set -g base-index 1
bind r source-file ~/.tmux.conf \; display "Reloaded!"
|
Apply: tmux source-file ~/.tmux.conf or C-b r
Common Use Cases
Training Multiple Models
1 2 3 4 5 6 7 8 9 10
| tmux new -s training
C-b c python train_model1.py C-b c python train_model2.py
C-b d
|
Sync Commands to Multiple Panes
1 2 3 4 5 6 7 8 9
| C-b " C-b "
C-b :setw synchronize-panes on
|
Quick Reference
| Command |
Action |
tmux new -s name |
Create session |
tmux ls |
List sessions |
tmux a -t name |
Attach session |
C-b d |
Detach |
C-b c |
New window |
C-b n/p |
Next/prev window |
C-b % |
Split vertical |
C-b " |
Split horizontal |
C-b ←↑↓→ |
Navigate panes |
C-b z |
Zoom pane |
C-b [ |
Scroll mode |
C-b ? |
Help |