Is is it possible to type a command once and run it over several servers connected via ssh using tmux?
Advertisement
Answer
What you are looking for might be “synchronize-panes”. With this option turned on, every keystroke is deliver to every pane of current window. Therefore, you can achieve your goal by:
Split a tmux window into multiple panes and ssh to different servers in each panes
turn on the aforementioned option. i.e.
tmux set-window-option synchronize-panes
type whatever command you intended.
In fact, I bond that option to Prefix + C-s in my tmux.conf:
bind-key C-s set-window-option synchronize-panes