LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

waitpid

Wait for arbitrary processes to terminate

TLDR

Wait for processes to exit
$ waitpid [pid1] [pid2]
copy
Wait with timeout
$ waitpid -t [n] [pid1] [pid2]
copy
Ignore already exited processes
$ waitpid -e [pid1] [pid2]
copy
Wait for N processes
$ waitpid -c [n] [pid1] [pid2]
copy
Display help
$ waitpid -h
copy

SYNOPSIS

waitpid [OPTIONS] PID...

DESCRIPTION

waitpid waits for the termination of arbitrary processes by their PIDs. Unlike the shell built-in wait, it can wait for any process, not just children of the current shell.The command blocks until all specified processes have terminated or the timeout expires.

PARAMETERS

-t, --timeout SECONDS

Maximum time to wait
-e, --exited
Don't error if PIDs have already exited
-c, --count N
Wait until N processes have exited
-h, --help
Display help information

INSTALL

sudo apt install util-linux-extra
copy
sudo apk add util-linux-misc
copy

CAVEATS

Part of util-linux. Can only monitor processes visible to the current user. Requires appropriate permissions to monitor processes.

SEE ALSO

wait(1), kill(1)

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid