220-1102 Question 261
Single answercatA junior technician is troubleshooting a Linux workstation that fails to start a custom application at login. The application reads its settings from /etc/myapp.conf. To quickly verify whether the configuration file contains the expected startup parameters, the technician wants to display the file's contents directly in the terminal without opening an editor. Which command should the technician use?
- A
cat /etc/myapp.conf
- B
grep /etc/myapp.conf
- C
chmod /etc/myapp.conf
- D
mv /etc/myapp.conf /tmp/
Show answer and explanation
Correct answer: A
Explanation
This question tests practical Linux command-line usage relevant to A+ Core 2 objectives covering basic shell commands and file management. The cat command is commonly used to concatenate and display file contents, and in support scenarios it is often the fastest way to inspect a small configuration file from the terminal. By contrast, grep is intended for pattern matching, chmod manages permissions, and mv relocates or renames files. Standard Linux documentation such as the GNU coreutils manual and the cat man page describe cat as a utility for reading files and writing their contents to standard output.
- A. Correct.
Correct. The cat command displays the contents of a file directly to standard output. In this scenario, using cat /etc/myapp.conf is an appropriate quick way to view the configuration file in the terminal and confirm whether the expected parameters are present.
- B. Incorrect.
Incorrect. grep is used to search for text patterns within input or files, but grep /etc/myapp.conf by itself is incomplete because it does not specify a search pattern. A technician might choose this if they confuse searching within a file with displaying the entire file.
- C. Incorrect.
Incorrect. chmod changes file permissions; it does not display file contents. This distractor reflects a common confusion between commands used to interact with files and commands used to read them.
- D. Incorrect.
Incorrect. mv moves or renames files. Moving the configuration file to /tmp/ would not help verify its contents and could actually break the application further by relocating a required config file.