101-500 Exam QuestionsBrowse all questions from this exam

101-500 Exam - Question 104


Which of the following commands generates a list of user names from /etc/passwd along with their login shell?

Show Answer
Correct Answer: E

The correct command to generate a list of user names from /etc/passwd along with their login shell is 'cut -d: -f1,7 /etc/passwd'. The 'cut' command is used to extract sections from each line of files. The '-d' option specifies the delimiter, which is ':' in the case of /etc/passwd, and the '-f' option specifies the fields to extract, which are the 1st (username) and the 7th (login shell) fields.

Discussion

2 comments
Sign in to comment
GoenaOption: E
Sep 24, 2022

E is correct: cut -d: -f 1,7 /etc/passwd - outcome: daemon:/usr/sbin/nologin

AmycertOption: E
Feb 8, 2023

cut again, just like the previous question