From 3b0142cedcde39e4c2097ecd916a870a3ced5ec6 Mon Sep 17 00:00:00 2001 From: Vito Graffagnino Date: Tue, 8 Sep 2020 18:10:49 +0100 Subject: Added the relevent parts of the .config directory. Alss add ssh config --- vimwiki/Tmux.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 vimwiki/Tmux.md (limited to 'vimwiki/Tmux.md') diff --git a/vimwiki/Tmux.md b/vimwiki/Tmux.md new file mode 100644 index 0000000..f65e633 --- /dev/null +++ b/vimwiki/Tmux.md @@ -0,0 +1,21 @@ +# Using shell scripting to setup your tmux environment # + +Can use a simple bootstrap script to setup tmux environment and log into it. +example script + +`#!/bin/sh` +`tmux new-session -d -s hawkhost` + +`tmux new-window -t hawkhost:1 -n 'Server1' 'ssh root@10.x.x.x'` +`tmux new-window -t hawkhost:2 -n 'Server2' 'ssh root@10.x.x.x'` +`tmux new-window -t hawkhost:3 -n 'Server3' 'ssh root@10.x.x.x'` +`tmux new-window -t hawkhost:4 -n 'Server4' 'ssh root@10.x.x.x'` +`tmux new-window -t hawkhost:5 -n 'Server5' 'ssh root@10.x.x.x'` + +`tmux select-window -t hawkhost:1` +`tmux -2 attach-session -t hawkhost` + + +`new-session -d -s hawkhost` creates new session, names it and detaches it. +The new-window commands create 5 new windows and executes the commands. +The last two commands sets the active window and then attaches to the session -- cgit v1.2.3