LPIC-1 Exam 101 v5 (Linux Administrator) — Question 16
Which of the following commands display the IDs of all processes owned by root? (Choose two.)
Answer options
- A. pgrep -c root
- B. pgrep -u root
- C. pgrep -f root
- D. pgrep -U 0
- E. pgrep -c 0
Correct answer: B, D
Explanation
The correct answers are B and D because 'pgrep -u root' lists the process IDs for processes owned by the user root, while 'pgrep -U 0' does the same by using the user ID for root (which is 0). Options A, C, and E do not specifically target processes owned by root in the correct manner, hence they are not correct.