On Unix-like operating systems, wait is a shell command that waits for a given process to complete, then returns its exit status.

This page covers the bash built-in version of wait.

Syntax

wait [pid] [jobid]

Description

wait waits for the process identified by process ID pid (or the job specified by job ID jobid), and reports its termination status. If an ID is not given, wait waits for all currently active child processes, and the return status is zero. If the ID is a job specification, wait waits for all processes in the job’s pipeline.

  • Description
  • Syntax
  • Examples
  • Related commands
  • Linux commands help

Examples

wait 2017

Wait for process 2017 to terminate, and return its exit status.

csh — The C shell command interpreter.jobs — List the status of all running jobs.ksh — The Korn shell command interpreter.sh — The Bourne shell command interpreter.