tmux
17 commands
17 shown
New named session
Start a new tmux session named 'work'
tmux new-session -s work
Attach to session
Attach to an existing named session
tmux attach-session -t work
List sessions
Show all active tmux sessions
tmux ls
Detach from session
Detach from current session leaving it running in background
<prefix> d
Kill session
Terminate a named session and all its windows
tmux kill-session -t work
Split pane horizontally
Split current pane into left and right
<prefix> %
Split pane vertically
Split current pane into top and bottom
<prefix> "
Navigate between panes
Move focus to adjacent pane
<prefix> <arrow keys>
Resize pane
Resize current pane down 5 rows (-U up, -L left, -R right)
tmux resize-pane -D 5
New window
Create a new window in current session
<prefix> c
Rename window
Rename the current window
<prefix> ,
Switch window by number
Jump to window by its index number
<prefix> 0-9
Enter copy mode
Enter scroll/copy mode; use arrows or vi keys to navigate
<prefix> [
Synchronize panes
Send keystrokes to all panes simultaneously (multi-server ops)
tmux setw synchronize-panes on
Send command to all panes
Run a command in every pane of the current session
tmux list-panes -s -F '#{session_name}:#{window_index}.#{pane_index}' | xargs -I{} tmux send-keys -t {} 'uptime' Enter
Scripted detached session
Spawn background session and inject a command; survives SSH disconnect
tmux new-session -d -s work && tmux send-keys -t work 'tail -f /var/log/app.log' Enter
Capture pane scrollback
Dump last 3000 lines of a pane to a file for triage without attaching
tmux capture-pane -p -S -3000 -t work > /tmp/pane.log
no commands match