Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
If you want to start multiple session in tmux with shell scripting. Tmux, shell script, shell
# just for test and show case
mkdir test_1 test_2
echo "current tmux sessions"
tmux ls
echo "kill all tmux sessions"
tmux kill-server
declare -a directories=("test_1" "test_2")
for i in "${directories[@]}"
do
cd ${i}
pwd
tmux new -d -s ${i} "ls -la"
cd ..
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment