What command is used to view the contents of a log file in real-time?

Disable ads (and more) with a premium pass for a one time $4.99 payment

Prepare for the Red Hat Certified Architect Exam with our comprehensive quiz. Master your skills with multiple choice questions and detailed explanations. Gear up to excel!

The command used to view the contents of a log file in real-time is tail -f. This command is particularly useful for monitoring log files as it allows you to see new lines that are added to the file as they happen. The -f option stands for "follow," meaning that the command will output appended data as the file grows, enabling users to track log updates without having to continuously reopen the file.

In contrast, cat displays the entire contents of a file at once, which isn't suitable for real-time monitoring, especially as log files can be large. The less command allows users to scroll through a file, but it does not have the feature to follow the file’s growth in real-time. Similarly, view, which is similar to less, is designed for viewing files but lacks the dynamic updates offered by tail -f.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy