exam questions

Exam LFCS All Questions

View all questions & answers for the LFCS exam

Exam LFCS topic 1 question 78 discussion

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

Which of the following commands will print the last 10 lines of a text file to the standard output?

  • A. cat -n 10 filename
  • B. dump -n 10 filename
  • C. head -n 10 filename
  • D. tail -n 10 filename
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
9866666
5 months, 1 week ago
Selected Answer: D
The correct answer is D. tail -n 10 filename Explanation: tail is a command specifically designed to display the last part of a file. The -n 10 option instructs it to print the last 10 lines. cat is used to concatenate and print the entire contents of files. The -n option adds line numbers, but it won't limit the output to the last 10 lines. dump is not a standard Linux command for working with files. head is used to display the first part of a file. The -n 10 option would print the first 10 lines.
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 ...