nerdexam
GIAC

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.

Linux and Cryptography

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)
  • A
    7% (3)
  • B
    76% (35)
  • C
    13% (6)
  • D
    4% (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.

ATAIL -show /var/log/messages

TAIL -show is not a valid flag for the tail command and will result in an error.

BTAIL -f /var/log/messagesCorrect

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.

CTAIL -50 /var/log/messages

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.

DTAIL -view /var/log/messages

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

#tail command#log monitoring#Linux commands#real-time logging

Community Discussion

No community discussion yet for this question.

Full GSEC Practice