Send a command to all panes

Run a command (here uptime) 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

tool
tmux17 commands
tags
tmux

More tmux commands

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

    Start a background session and send a command to it; it keeps running after SSH disconnects

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

    Save the last 3000 lines of a pane to a file for review, without attaching

  • tmux new-session -s work

    Start a new tmux session called "work"

  • tmux attach-session -t work

    Attach to an existing session by name

  • tmux ls

    Show all running tmux sessions

all 17 tmux commands