To display the last 10 lines of a file, which command should be used?

Study for the Linux Fundamentals Test. Enhance your skills with flashcards and multiple-choice questions. Each question has hints and explanations. Get ready for your exam!

The command that is used to display the last 10 lines of a file is 'tail.' This command specifically reads the end of a file and outputs the last part, which by default is the last 10 lines. This functionality is particularly useful for monitoring log files or quickly fetching recent entries without having to view the entire file.

The behavior of 'tail' can be modified by using options such as '-n' to specify a different number of lines if needed, but its default behavior of showing the last 10 lines makes it straightforward for quick analysis of the data at the end of a file.

Other commands listed serve different purposes: 'head' displays the first part of a file, 'cat' is used to concatenate and display the entire file content, and 'more' allows for paginated viewing of a file's content but does not specifically target the last lines. Thus, among the choices provided, 'tail' is the correct command for this function.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy