commands

jobs — list shell jobs

Report jobs tracked by the current shell, not all processes. -p prints the process group leader PID for each listed job. Use a fresh private workspace, ordinary user and bounded child processes; no sudo.

Formal Syntax & Structure

linux syntaxlinux
jobs [-l|-p]

Parameters & Attributes

NameTypeDescription
-loptioninclude PIDs
-poptionprint process group leader PID

Return Value

exit status and output

Report jobs tracked by the current shell, not all processes. -p prints the process group leader PID for each listed job.

Working Example

Example Snippetlinux
sleep 1 &child=$!jobs -p | grep -Fx "$child" >/dev/null && printf 'job tracked\n'wait "$child"
Linux Reference