Wait for a specific background process.
Section: Job Control
Wait for background PID
bash
bash
pid=$!
wait "$pid"Explanation
Capture $! right after starting a job.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Job Control