# Running Work in Parallel: &, wait and xargs -P

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.

![Cheat sheet for the lesson Running Work in Parallel: &, wait and xargs -P: 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…](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/11/81f08aa5db884a5a909dcd48c610ce8d.webp)

- Category: Bash
- Level: Freelancer
- Tags: background-job, cpu-core, linux, parallel-processing, unix, wait, xargs
- Updated: November 10, 2026

Source: https://www.ask-codey.com/cheat-sheets/bash-parallel-jobs-cheat-sheet
