XK0-005 · Question #10310
A systems administrator wants to list all local accounts in which the UID is greater than 500. Which of the following commands will give the correct output?
The correct answer is C. awk -F: '$3 > 500 {print $1}' /etc/passwd. The correct command to list all local accounts in which the UID is greater than 500 is: awk -F: '$3 > 500 {print $1}' /etc/passwd This command uses awk to process the /etc/passwd file, which contains information about the local users on the system. The -F: option specifies that…
Question
Options
- Afind /etc/passwd -size +500
- Bcut -d: -f1 /etc/passwd > 500
- Cawk -F: '$3 > 500 {print $1}' /etc/passwd
- Dsed '/UID/' /etc/passwd < 500
How the community answered
(21 responses)- A5% (1)
- B10% (2)
- C81% (17)
- D5% (1)
Explanation
The correct command to list all local accounts in which the UID is greater than 500 is: awk -F: '$3 > 500 {print $1}' /etc/passwd This command uses awk to process the /etc/passwd file, which contains information about the local users on the system. The -F: option specifies that the fields are separated by colons. The $3 refers to the third field, which is the UID. The condition $3 > 500 filters out the users whose UID is greater than 500. The action {print $1} prints the first field, which is the username.
Topics
Community Discussion
No community discussion yet for this question.