Hacker News new | past | comments | ask | show | jobs | submit login

More of a normal tmux question, but is there a way to input the window number, or is there a fast way to open up ssh to 4 servers numbered sequentially?

pane 1: ssh <server>-1

pane 2: ssh <server>-2

pane 3: ssh <server>-3

pane 4: ssh <server>-4




When I need to do cluster ssh with tmux I do this or a variant of it:

  function cluster_ssh() { 
    # Start a pane for every server
    for server in $*; do
      tmux split-window ssh $server
    done;

    # Same input to all panes
    tmux setw synchronize-panes on;

    # Init pane to background, tile layout
    tmux break-pane -s 0 -d
    tmux select-layout tiled
  }

  bash# cluster_ssh server-{01..10}.example.com


EDIT: made it a bit more complete, but you only need split and sync panes IMHO.





Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: