H13-511_V5.5 practice question 10 of 10

Which of the following commands are used to view common files on Linux?

Full set: 60 questions
Answer options
A: less Correct answer
B: more Correct answer
C: vim
D: cat Correct answer
Correct Answer:
A. less; B. more; D. cat
Explanation

The commands cat, less, and more are standard Linux utilities primarily used for viewing the contents of text files. The cat (concatenate) command reads files sequentially and writes their entire content to standard output. For larger files, more and less are pager programs that display content one screen at a time. less is a more modern and feature-rich version of more, allowing for both backward and forward navigation within the file.

Why Incorrect

C. vim is a powerful text editor. While a file's content is visible when opened in vim, its primary function is to create or modify files, not simply to view them.

References

1. Huawei HCIA-Cloud Computing V5.0 Training Material. (2022). Chapter 3: Linux Operating System Basics. Section 3.3, "Common Linux Commands," lists cat, more, and less as commands for viewing file contents, while vi/vim is categorized under file editing.

2. Sobell, M. G. (2018). A Practical Guide to Linux Commands, Editors, and Shell Programming (4th ed.). Prentice Hall. Chapter 4, "Viewing Files," is dedicated to the usage of cat, more, and less.

Scroll to Top