Skip to content

Running Commands in Multiple Panes with tmux

Published: at 04:37 PM

Need to monitor different commands at the same time in your terminal? tmux, a terminal multiplexer, makes it easy to split your terminal into multiple panes and run different commands simultaneously. Here’s how.

The Basic Command

tmux new-session "ls; exec zsh" \; split-window -h -p 66 "ls; exec zsh" \; split-window -h -p 50 "ls; exec zsh"

Let’s break this down:

Customizing The Layout

You can adjust the splits by modifying the -p values:

Using Different Shells

The command above uses zsh, but you can use bash instead:

tmux new-session "ls; exec bash" \; split-window -h -p 66 "ls; exec bash" \; split-window -h -p 50 "ls; exec bash"

Practical Uses

This setup is perfect for:

Once you’re in tmux, you can navigate between panes using Ctrl-b followed by arrow keys. Try it out and customize the commands to fit your workflow!


Next Post
Running Commands in Multiple Panes with Windows Terminal