Which command is used to display the contents of a file line by line?

Prepare for the LPI Linux Essentials 010-160 Test. Study with flashcards and multiple choice questions, each question offers hints and explanations. Get ready to ace your exam!

The command that is used to display the contents of a file line by line is "less." This command allows users to view the contents of a file one screen at a time, making it especially useful for larger files. When using less, you can scroll through the content both forwards and backwards, which provides greater flexibility in navigating the file. Additionally, less does not load the entire file into memory at once, making it more efficient for viewing large files compared to other commands.

This interactive viewing capability is a crucial feature when working with lengthy files, as it prevents overwhelming the user with an entire file dump at once and allows for a more controlled reading experience. In contrast, other commands like cat output the entire file's content at once, which may not be ideal for larger files.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy