101-500 Exam QuestionsBrowse all questions from this exam

101-500 Exam - Question 91


Which of the following commands display the IDs of all processes owned by root? (Choose two.)

Show Answer
Correct Answer: BD

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.

Discussion

10 comments
Sign in to comment
linderOptions: BD
Apr 25, 2020

I think it's B and D

cast7omadrid1
May 8, 2020

You are right, I have tried it and it is correct.

wvdw1962
Jan 9, 2022

tried it on Fedora 35: its B and D

mikebd
Jul 10, 2020

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 ....

MalvadaOptions: BD
Nov 27, 2020

Also checked this, its B & D

CuriousLinuxCatOptions: BD
Jul 24, 2021

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

penguinx64Options: BD
Feb 22, 2021

-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.

BodescuOptions: BD
Jun 15, 2021

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 )

LollosbrolloOptions: BD
Jun 30, 2022

B and D

iwkno6Options: BD
Jul 28, 2021

Agree with B & D

anhcqOptions: BD
Nov 26, 2021

Tried, B and D are correct

LazylinuxOptions: BD
Apr 22, 2022

Tested all good