Which of the following commands generates a list of user names from /etc/passwd along with their login shell?
Which of the following commands generates a list of user names from /etc/passwd along with their login shell?
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.
E is correct: cut -d: -f 1,7 /etc/passwd - outcome: daemon:/usr/sbin/nologin
cut again, just like the previous question