Skip to content

Instantly share code, notes, and snippets.

@AICDEV
Last active June 19, 2019 18:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AICDEV/cf1497793bb1c27cb9b94d56c209ad6f to your computer and use it in GitHub Desktop.
Save AICDEV/cf1497793bb1c27cb9b94d56c209ad6f to your computer and use it in GitHub Desktop.
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