pkill Interview Questions and Answers¶
Introduction¶
These questions test whether you understand what pkill does, when to use it, and how to verify the result on Linux.
Beginner Questions¶
What does pkill do?
It sends signals to processes selected by name or pattern.
Show a basic command.
pkill firefox
Intermediate Questions¶
Name useful options.
-u: match processes by user.-f: match full command line.-HUP: send SIGHUP.
Show a common administrator command.
sudo pkill -HUP rsyslogd
Scenario-Based Questions¶
How would you handle pkill vs kill?
pkill -u student
What would you verify afterward?
pgrep -a firefox
Expected output should look similar to:
2345 /usr/lib64/firefox/firefox
2351 /usr/lib64/firefox/firefox -contentproc
Practical Task Questions¶
Practice in a lab by running a safe version of the command, explaining the target, and showing the verification output.
Quick Review¶
pkill firefox
sudo pkill -HUP rsyslogd
pgrep -a firefox
Related Guides¶
Summary¶
A strong pkill answer includes the purpose, a correct example, a common mistake, and a verification command with output you can interpret.