Send the normal termination request to every permitted process whose name is worker.
Do not list PIDs individually.
Which command is appropriate?
The Linux psmisc killall command sends a signal to processes whose names match. Check permissions and platform-specific semantics.
Detailed explanation
pgrep workerIncorrect. pgrep prints matching PIDs but does not send a signal.
Incorrect. pgrep prints matching PIDs but does not send a signal.
jobs workerIncorrect. jobs is limited to the current shell's job table.
Incorrect. jobs is limited to the current shell's job table.
kill workerIncorrect. kill expects PIDs or signal syntax, not a process name in this form.
Incorrect. kill expects PIDs or signal syntax, not a process name in this form.
killall workerCorrect. killall worker requests normal termination for matching processes.
Correct. killall worker requests normal termination for matching processes.
Try it yourself
An example you can run in a temporary verification environment.
killall --help 2>&1 | headExpected result
psmisc killallのhelp。signalは送らないKey points
- killall
- Process name
- SIGTERM
Notes
- Environment: Linux psmisc系killall help
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.