Which command shows errors since last boot?

Prepare for the Google Data Center Technician Exam. Study with flashcards and multiple choice questions, each question has hints and explanations. Get ready for your exam!

Multiple Choice

Which command shows errors since last boot?

Explanation:
The key thing here is how to view logs for the current boot and limit them to actual errors. Using the systemd journal is ideal for this because you can target a specific boot and filter by severity in one command. The -b flag confines the output to the current boot, so you’re looking at what happened since the system was started. The -p option selects a priority level; err means only error-level events (and higher if present) are shown. Put together, the command shows exactly the error messages that occurred during the most recent boot. Other options aren’t as precise for this goal. dmesg provides kernel messages, which are useful, but you’d have to manually filter for errors and it isn’t tied to the boot boundary in the same explicit way. Tailing a syslog file grabs the most recent lines from the log file, but those lines can span multiple boots or be affected by rotation, so it isn’t guaranteed to reflect just the current boot. And requesting info-level logs includes non-error messages and doesn’t constrain to the last boot unless you add more filtering.

The key thing here is how to view logs for the current boot and limit them to actual errors. Using the systemd journal is ideal for this because you can target a specific boot and filter by severity in one command. The -b flag confines the output to the current boot, so you’re looking at what happened since the system was started. The -p option selects a priority level; err means only error-level events (and higher if present) are shown. Put together, the command shows exactly the error messages that occurred during the most recent boot.

Other options aren’t as precise for this goal. dmesg provides kernel messages, which are useful, but you’d have to manually filter for errors and it isn’t tied to the boot boundary in the same explicit way. Tailing a syslog file grabs the most recent lines from the log file, but those lines can span multiple boots or be affected by rotation, so it isn’t guaranteed to reflect just the current boot. And requesting info-level logs includes non-error messages and doesn’t constrain to the last boot unless you add more filtering.