Process Management
wait
Wait for background processes or jobs to complete before continuing.
Synopsis
syntax
wait [PID|JOBSPEC]...
Examples
Run two commands in parallel, wait for both
command1 & command2 & wait
Wait for most recent background process
wait $!
Wait for specific jobs to complete
wait %1 %2
Common options
| Flag | Description |
|---|---|
| -n | Wait for any single job to complete |
| -f | Wait for actual termination, not just status change |
About wait
The `wait` command wait for background processes or jobs to complete before continuing. Process management commands let you monitor, control, and schedule running processes.
Linux is a multitasking operating system, and understanding how to list processes, send signals, adjust priorities, and manage background jobs is vital for system administration and debugging performance issues. The command accepts 2 commonly used flags shown above, though the full set of options is available in the man page (`man wait`).
The 3 examples on this page cover typical real-world usage patterns that you can copy and adapt for your own workflows.
Related commands
More Process Management Commands
Other commands in the Process Management category