Courseiva
Shells, Scripting and Data ManagementhardMultiple ChoiceObjective-mapped

LPIC-1 Shells, Scripting and Data Management Practice Question

A script starts multiple background processes. An administrator wants to wait for all background jobs to complete before proceeding. Which command should be used?

⚠ Common exam trap

A common mix-up: candidates confuse `wait` with `jobs` or assume that a fixed sleep duration is sufficient, not realizing that `wait` is the only command that dynamically synchronizes with the actual completion of all background jobs.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

wait

The `wait` command without any arguments waits for all background jobs spawned by the current shell to complete before returning control to the script. This is the correct way to synchronize multiple background processes in a shell script, ensuring all child processes finish before proceeding to the next command.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • jobs -l

    Why it's wrong here

    Lists background jobs but does not wait for them.

  • wait %1

    Why it's wrong here

    Waits only for the first background job, not all.

  • wait

    Why this is correct

    Waits for all background jobs to complete.

  • sleep 5

    Why it's wrong here

    Pauses for 5 seconds but does not ensure background jobs are complete.

Visual reference

Client Server SYN (seq=100) SYN-ACK (seq=200, ack=101) ACK (ack=201) Connection established — data transfer begins

About these practice questions

Courseiva writes every LPIC-1 question from scratch — 527 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This LPIC-1 practice question is part of Courseiva's free LPI certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the LPIC-1 exam.