CompTIA Linux+ Powered by LPI (LX0-103) — Question 14

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

Answer options

Correct answer: D

Explanation

The correct command is 'tail -n 10 filename', which specifically retrieves the last 10 lines of a file. The 'cat' command with '-n' lists all lines with line numbers, 'dump' is not a standard command for this purpose, and 'head -n 10 filename' shows the first 10 lines instead of the last.