Which command lists the active state of all loaded service unit configuration files?

Prepare for the Red Hat Certified Systems Admin Exam EX200. Enhance your skills with interactive quizzes, flashcards, and detailed explanations. Ace your certification exam today!

Multiple Choice

Which command lists the active state of all loaded service unit configuration files?

Explanation:
To see which service units are currently loaded and what they’re doing, you query systemd’s in-memory list of units and filter for services. The command systemctl list-units --type=service shows exactly that: it lists all service units that are loaded in memory and their current state, including the Active and Sub columns that tell you whether a service is running, stopped, or in another state. By focusing on service units, it gives you a complete picture of the runtime activity of all loaded service configurations. If you wanted information about a unit’s configuration file on disk rather than its running state, or you wanted to see units regardless of whether they’re active, other commands would be appropriate, but for the active runtime status of loaded service units, this is the right choice.

To see which service units are currently loaded and what they’re doing, you query systemd’s in-memory list of units and filter for services. The command systemctl list-units --type=service shows exactly that: it lists all service units that are loaded in memory and their current state, including the Active and Sub columns that tell you whether a service is running, stopped, or in another state. By focusing on service units, it gives you a complete picture of the runtime activity of all loaded service configurations.

If you wanted information about a unit’s configuration file on disk rather than its running state, or you wanted to see units regardless of whether they’re active, other commands would be appropriate, but for the active runtime status of loaded service units, this is the right choice.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy