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
More tmux commands
-
tmux new-session -d -s work && tmux send-keys -t work 'tail -f /var/log/app.log' EnterStart 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.logSave the last 3000 lines of a pane to a file for review, without attaching
-
tmux new-session -s workStart a new tmux session called "work"
-
tmux attach-session -t workAttach to an existing session by name
-
tmux lsShow all running tmux sessions