# Many Things at Once

Several terminals in one window, waiting for things, and running work in parallel.

Updated: November 10, 2026

## [Several Terminals](https://www.ask-codey.com/courses/bash-in-depth/topics/bash-several-terminals)

1. [tmux: Panes, Windows and Sessions](https://www.ask-codey.com/lessons/bash-tmux) (Journeyman): tmux runs several terminals inside one window, split into panes and windows, and keeps them in a session that goes on running when you detach, close the window or lose the connection to a server, so you can attach again and carry on.

## [Waiting and Watching](https://www.ask-codey.com/courses/bash-in-depth/topics/bash-waiting-and-watching)

1. [Waiting for Things: watch, until and timeout](https://www.ask-codey.com/lessons/bash-watch-and-wait) (Journeyman): watch reruns a command every few seconds and shows its latest result, an until loop waits until a server answers, and timeout stops a command that takes too long, with exit code 124, so a script never waits forever.
2. [Running Work in Parallel: &, wait and xargs -P](https://www.ask-codey.com/lessons/bash-parallel-jobs) (Freelancer): Commands that each take a while can run side by side: & starts each one in the background and wait holds the script until all of them have finished, while xargs -P runs a set number at a time, so 12 one-second photo resizes take 3 seconds instead of 12.

## [Exercise: Three Things at Once](https://www.ask-codey.com/courses/bash-in-depth/topics/exercise-bash-three-things-at-once)

1. [Exercise: Three Things at Once](https://www.ask-codey.com/lessons/exercise-bash-three-things-at-once) (Freelancer): Write three tools for a day's work on Bluebird Bakery's website: three-panes.sh sets up the server, the tests rerunning in watch and a free terminal in one tmux session, wait-for-site.sh waits for the site and gives up at a time limit, and resize-all.sh resizes photos four at a time, while a check script tells you what's done.

Source: https://www.ask-codey.com/courses/bash-in-depth/chapters/bash-many-things-at-once
