← 返回命令列表

Linux command

waitpid 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Example

waitpid [pid1] [pid2]

Example

waitpid -t [n] [pid1] [pid2]

Example

waitpid -e [pid1] [pid2]

Example

waitpid -c [n] [pid1] [pid2]

Example

waitpid -h

说明

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.

参数

-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

FAQ

What is the waitpid command used for?

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.

How do I run a basic waitpid example?

Run `waitpid [pid1] [pid2]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -t, --timeout _SECONDS_ do in waitpid?

Maximum time to wait