Master Linux Like a Pro: Dive into the 2026 RHEL Red Hat Challenge!

1 / 400

Which command is used to view the logs for a service managed by systemd?

journalctl -u [service]

The command that is used to view the logs for a service managed by systemd is indeed the one that employs `journalctl -u [service]`. This command interacts with the journal, which is a component of systemd responsible for logging service messages. By specifying the `-u` option followed by the name of the service, you can retrieve logs specifically related to that service, showing all relevant entries from the journal.

Using this command provides a comprehensive view of the service's logs, including error messages, informational logs, and other output that the service may generate. This is especially useful for troubleshooting issues related to the service's operation, as it allows administrators to see real-time and historical logs in a structured way.

In contrast, the other options do not accurately retrieve logs in the same way. For instance, the second option, which mentions `systemctl logs [service]`, does not exist as a valid command, as `systemctl` does not directly handle log retrieval. The third option, `service [service] status`, retrieves the status of the service but does not provide access to the log entries themselves. Lastly, using `tail -f /var/log/[service].log` implies that logs are stored in a standard log file

Get further explanation with Examzify DeepDiveBeta

systemctl logs [service]

service [service] status

tail -f /var/log/[service].log

Next Question
Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy