Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: Tmuxall – start a list of commands into 1 tmux session
1 point by bosky101 12 months ago | hide | past | favorite
$ cat commands.txt

    echo "any command you want to run"
    echo "on a different line"
    cd $HOME/dev/CH && clickhouse server
    cd $HOME/dev/CH && clickhouse client
    tail -f some/log
    cd some/path && docker-compose up -d
    psql
$ cat ./tmuxall

    #!/bin/sh
    tmux new-session -d -s $USER
    while read cmd
    do
    echo $cmd
    tmux send "$cmd" ENTER;
    tmux split-window;
    done < $1
    tmux a
Make it executable

    $ chmod +x ./tmuxall

Usage (after you have installed tmux)

    $ ./tmuxall commands.txt
Screenshot here

    https://i.ibb.co/JBjsXKk/Screenshot-2024-02-22-at-11-46-44-AM.png



Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: