Which of the following commands display the IDs of all processes owned by root? (Choose two.)
Which of the following commands display the IDs of all processes owned by root? (Choose two.)
To display the IDs of all processes owned by root, you can use the commands that match the user 'root'. The command 'pgrep -u root' (option B) uses the '-u' flag to specify the user by name. Similarly, 'pgrep -U 0' (option D) uses the '-U' flag to specify the real user ID of 0, which corresponds to the root user in Unix-like systems.
I think it's B and D
You are right, I have tried it and it is correct.
tried it on Fedora 35: its B and D
There are a quite a few mistakes on this site :D And however they have generated the questions needs a bit of work, things like - and "" are not handled correctly ....
Also checked this, its B & D
Correct Answer: BD B is correct because it specifies user of 'root' with -u. D is correct because it matches 'real user ID' with uid of 0 (which I assume is the default.) What is the real user ID? Who you really are (the person who owns the proess). A unique number for a user in the system. What is pgrep? Look at running processes and lists the process ID to STDOUT. For example: pgrep -u root sshd Will only list the process ID's that are owned by root (user). Example 2: pgrep -u user -l Will list the process ID and name used by 'user'. -c count -u user -l list process name as will as process ID
-U makes sense, but -f does not -U, --uid uid,... Only match processes whose real user ID is listed. Either the numerical or symbolical value may be used. -f, --full The pattern is normally only matched against the process name. When -f is set, the full command line is used.
B&D get the point. Verified :) (To whom is validating our comments... Please tell whoever may care, to do his/ her the f job and do correct the tests: Who wants to purchase anything full of mistakes? TY xD )
B and D
Agree with B & D
Tried, B and D are correct
Tested all good