GSEC · Question #236
You work as a Network Administrator for McNeil Inc. You are installing an application. You want to view the log file whenever a new entry is added to the /var/log/messages log file. Which of the…
The correct answer is B. TAIL -f /var/log/messages. The tail -f command follows a file in real time, printing new lines as they are appended, which is the standard way to monitor live log files.
Question
You work as a Network Administrator for McNeil Inc. You are installing an application. You want to view the log file whenever a new entry is added to the /var/log/messages log file. Which of the following commands will you use to accomplish this?
Options
- ATAIL -show /var/log/messages
- BTAIL -f /var/log/messages
- CTAIL -50 /var/log/messages
- DTAIL -view /var/log/messages
How the community answered
(46 responses)- A7% (3)
- B76% (35)
- C13% (6)
- D4% (2)
Why each option
The tail -f command follows a file in real time, printing new lines as they are appended, which is the standard way to monitor live log files.
TAIL -show is not a valid flag for the tail command and will result in an error.
tail -f (follow mode) keeps the file open and continuously outputs new lines as they are written to /var/log/messages, allowing an administrator to monitor log activity in real time. This is the canonical Linux tool for watching live log entries without repeatedly re-running a command. The process runs until interrupted with Ctrl+C.
TAIL -50 outputs the last 50 lines of the file at the time of execution but does not follow or display new entries added afterward.
TAIL -view is not a valid flag for the tail command and will result in an error.
Concept tested: Linux tail -f command for real-time log monitoring
Source: https://man7.org/linux/man-pages/man1/tail.1.html
Topics
Community Discussion
No community discussion yet for this question.