waitpid - Man Page
utility to wait for arbitrary processes
Examples (TL;DR)
- Sleep until all processes whose PIDs have been specified have exited:
waitpid pid1 pid2 ...
- Sleep for at most
n
seconds:waitpid --timeout n pid1 pid2 ...
- Do not error if specified PIDs have already exited:
waitpid --exited pid1 pid2 ...
- Sleep until
n
of the specified processes have exited:waitpid --count n pid1 pid2 ...
- Display help:
waitpid -h
Synopsis
Description
waitpid is a simple command to wait for arbitrary non-child processes.
It exits after all processes whose PIDs have been passed as arguments have exited.
Options
- -v, --verbose
Be more verbose.
- -t, --timeout seconds
Maximum wait time.
- -e, --exited
Don’t error on already exited PIDs.
- -c, --count count
Number of process exits to wait for.
- -h, --help
Display help text and exit.
- -V, --version
Print version and exit.
Exit Status
waitpid has the following exit status values:
- 0
success
- 1
unspecified failure
- 2
system does not provide necessary functionality
- 3
timeout expired
Authors
See Also
waitpid(2) wait(1P)
Reporting Bugs
For bug reports, use the issue tracker at https://github.com/util-linux/util-linux/issues.
Availability
The waitpid command is part of the util-linux package which can be downloaded from Linux Kernel Archive.
Info
2024-04-24 util-linux 2.40.2