101-400 Exam QuestionsBrowse all questions from this exam

101-400 Exam - Question 35


What command will generate a list of user names from /etc/passwd along with their login shell?

Show Answer
Correct Answer: D

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'. This command specifies ':' as the delimiter with '-d:' and selects the first and seventh fields, which correspond to the username and login shell, respectively.

Discussion

1 comment
Sign in to comment
DuboisNicolasDuclairOption: D
Oct 21, 2023

The command that will generate a list of user names from `/etc/passwd` along with their login shell is: D. `cut -d: -f1,7 /etc/passwd` This `cut` command specifies the delimiter (`-d:`) as a colon and selects fields (`-f1,7`) for the username and the login shell from the `/etc/passwd` file.