tmux commands

17 commands, each with a one-line explanation. Click a command to copy it, or its title for details.

Commands 17 shown

  • tmux new-session -s work

    Start a new tmux session named 'work'

  • tmux attach-session -t work

    Attach to an existing named session

  • tmux ls

    Show all active tmux sessions

  • <prefix> d

    Detach from current session leaving it running in background

  • tmux kill-session -t work

    Terminate a named session and all its windows

  • <prefix> %

    Split current pane into left and right

  • <prefix> "

    Split current pane into top and bottom

  • <prefix> <arrow keys>

    Move focus to adjacent pane

  • tmux resize-pane -D 5

    Resize current pane down 5 rows (-U up, -L left, -R right)

  • <prefix> c

    Create a new window in current session

  • <prefix> ,

    Rename the current window

  • <prefix> 0-9

    Jump to window by its index number

  • <prefix> [

    Enter scroll/copy mode; use arrows or vi keys to navigate

  • tmux setw synchronize-panes on

    Send keystrokes to all panes simultaneously (multi-server ops)

  • tmux list-panes -s -F '#{session_name}:#{window_index}.#{pane_index}' | xargs -I{} tmux send-keys -t {} 'uptime' Enter

    Run a command in every pane of the current session

  • tmux new-session -d -s work && tmux send-keys -t work 'tail -f /var/log/app.log' Enter

    Spawn background session and inject a command; survives SSH disconnect

    troubleshooting · monitoring

  • tmux capture-pane -p -S -3000 -t work > /tmp/pane.log

    Dump last 3000 lines of a pane to a file for triage without attaching

    debug · observability