Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.

Unlimited Access

Get Unlimited Contributor Access to the all ExamTopics Exams!
Take advantage of PDF Files for 1000+ Exams along with community discussions and pass IT Certification Exams Easily.

Exam LFCS topic 1 question 41 discussion

Actual exam question from Linux Foundation's LFCS
Question #: 41
Topic #: 1
[All LFCS Questions]

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

  • A. column -s : 1,7 /etc/passwd
  • B. chop -c 1,7 /etc/passwd
  • C. colrm 1,7 /etc/passwd
  • D. cut -d: -f1,7 /etc/passwd
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
Buruguduystunstugudunstuy
1 year, 3 months ago
Selected Answer: D
The command that will generate a list of user names from '/etc/passwd' along with their login shell is 'cut -d: -f1,7 /etc/passwd'. Option D is the correct answer. The 'cut' command is used to extract specific fields or columns from a file. The '-d' option specifies the delimiter, and the '-f' option specifies the fields to extract. In this case, the command will extract the first ('1') and seventh ('7') fields from '/etc/passwd', using a colon (':') as the delimiter. The '/etc/passwd' file contains a list of user accounts on the system, with each line representing a single user. The fields are separated by colons, the first field is the user name and the seventh field is the login shell. Therefore, the command will generate a list of user names from '/etc/passwd' along with their login shell.
upvoted 1 times
Buruguduystunstugudunstuy
1 year, 3 months ago
The other options do not accurately describe the behavior of the 'cut' command: Option A: The 'column' command is used to format the output of a command into columns, but it does not have the capability to extract specific fields or columns from a file. Option B: The 'chop' command is not a standard Linux command. Option C: The 'colrm' command is used to remove specific columns from a file, but it does not have the capability to extract specific fields or columns from a file.
upvoted 1 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...