Valid XK0-005 Dumps shared by ExamDiscuss.com for Helping Passing XK0-005 Exam! ExamDiscuss.com now offer the newest XK0-005 exam dumps, the ExamDiscuss.com XK0-005 exam questions have been updated and answers have been corrected get the newest ExamDiscuss.com XK0-005 dumps with Test Engine here:
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?
Correct Answer: C
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. The other commands are incorrect because: find /etc/passwd -size +500 will search for files that are larger than 500 blocks in size, not users with UID greater than 500. cut -d: fl / etc/ passwd > 500 will cut the first field of the /etc/passwd file using colon as the delimiter, but it will not filter by UID or print only the usernames. The > 500 part will redirect the output to a file named 500, not compare with the UID. sed '/UID/' /etc/passwd < 500 will use sed to edit the /etc/passwd file and replace any line that contains UID with 500, not list the users with UID greater than 500. The < 500 part will redirect the input from a file named 500, not compare with the UID. Reference: Linux List All Users In The System Command - nixCraft, section "List all users in Linux using /etc/passwd file". Unix script getting users with UID bigger than 500 - Stack Overflow, section "Using awk".