Which command shows all processes owned by the user bob?
A.
who -1 bob
B.
pgrep -u bob
C.
ps -o -a bob
D.
top bob
E.
last -p bob
The Answer Is:
B
This question includes an explanation.
Explanation:
The pgrep command is used to find processes by various criteria, such as user name, group name, process ID, command name, etc. The -u option specifies the user name or user ID to match. Therefore, the command pgrep -u bob will show all processes owned by the user bob. The output will be a list of process IDs, one per line. To show more information about the processes, such as command name, arguments, state, etc., the -l, -a, and -f options can be used. For example, the command pgrep -l -u bob will show the process ID and the command name for each process owned by bob. References:
pgrep - FreeBSD, the manual page for the pgrep command on FreeBSD.
How to use pgrep and pkill commands in Linux - Linuxize, a tutorial on how to use the pgrep and pkill commands in Linux.
702-100 PDF/Engine
Printable Format
Value of Money
100% Pass Assurance
Verified Answers
Researched by Industry Experts
Based on Real Exams Scenarios
100% Real Questions
Get 65% Discount on All Products,
Use Coupon: "ac4s65"