To display a file’s contents in Linux, the standard command is cat. Quentin Docter states: “Sometime you just need to view the contents of a file. To view the contents of a file, use the cat command,” and shows an example cat /etc/hosts displaying the file output. He also lists essential Linux commands and explicitly defines cat as: “Displays the contents of a file.”
The other options do not meet the requirement: chmod changes file permissions, ls lists directory contents (or file names), and sudo runs a command with elevated privileges—none directly display a file’s contents by themselves. A+ also expects you to know that cat can do more than display; it can concatenate files and redirect output, but for this question the key function is simply viewing a file.
Therefore, the correct command is cat (B).
Contribute your Thoughts:
Chosen Answer:
This is a voting comment (?). You can switch to a simple comment. It is better to Upvote an existing comment if you don't have anything to add.
Submit