CompTIA Linux+ (XK0-004) — Question 88
A Linux system is running normally when the systems administrator receives an alert that one application spawned many processes. The application is consuming a lot of memory, and it will soon cause the machine to become unresponsive. Which of the following commands will stop each application process?
Answer options
- A. kill `pidof application`
- B. killall application
- C. kill -9 `ps ג€"aux | grep application`
- D. pkill -9 application
Correct answer: B
Explanation
The correct answer is B, as the 'killall' command is specifically designed to terminate all processes associated with a given application name. Option A will only kill processes with specific PIDs returned by 'pidof', while option C uses 'kill' with a specific signal on processes filtered by 'grep', which is not as efficient. Option D, although it also targets processes by name, requires a signal and may not be as straightforward as 'killall'.