XK0-004 · Question #311
While installing third-party software, a technician wants to monitor logs on the system continuously. Which of the following commands should the technician issue to monitor the logs?
The correct answer is D. tail -f /var/log/messages. The technician needs a command that follows and displays new log entries in real time during software installation. The tail -f command is the standard Linux tool for this purpose.
Question
While installing third-party software, a technician wants to monitor logs on the system continuously. Which of the following commands should the technician issue to monitor the logs?
Options
- Acat /var/log/kern.log
- Bgrep -e /var/log/httpd/access.log
- Chead -n /var/log/secure
- Dtail -f /var/log/messages
How the community answered
(39 responses)- A3% (1)
- B5% (2)
- C3% (1)
- D90% (35)
Why each option
The technician needs a command that follows and displays new log entries in real time during software installation. The tail -f command is the standard Linux tool for this purpose.
The cat command reads and prints the entire file once then exits, providing no continuous or real-time monitoring capability.
The grep -e flag expects a regex pattern argument and searches static file contents for matches - it does not follow or monitor a file for new entries.
The head -n flag displays only the first N lines of a file and exits immediately, which is the opposite of what continuous monitoring requires.
The tail -f flag causes tail to follow the file, continuously outputting new lines as they are appended, which is exactly what is needed to monitor activity during an installation. The /var/log/messages file captures general system and application messages, making it a relevant target for watching third-party software behavior in real time.
Concept tested: Real-time log monitoring with tail -f
Source: https://man7.org/linux/man-pages/man1/tail.1.html
Topics
Community Discussion
No community discussion yet for this question.