Which command tails a log file in real time?

Prepare for the Google Data Center Technician Exam. Use our interactive quiz featuring flashcards and multiple choice questions with hints and explanations. Get exam-ready today!

Multiple Choice

Which command tails a log file in real time?

Explanation:
Following a log file as new entries are written is done with the tail command using the -f option. The -f flag keeps the file open and streams data as it’s appended, so you see each new log line in real time. That makes it ideal for live monitoring during troubleshooting. Without -f, tail just shows the last few lines at that moment and then stops, so it won’t update as new logs appear. Listing the file’s details with ls -l does not display the contents at all. Using cat prints the current content of the file once, but it doesn’t follow the file as it grows, so you’d need to run it again to see new lines.

Following a log file as new entries are written is done with the tail command using the -f option. The -f flag keeps the file open and streams data as it’s appended, so you see each new log line in real time. That makes it ideal for live monitoring during troubleshooting.

Without -f, tail just shows the last few lines at that moment and then stops, so it won’t update as new logs appear. Listing the file’s details with ls -l does not display the contents at all. Using cat prints the current content of the file once, but it doesn’t follow the file as it grows, so you’d need to run it again to see new lines.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy