Which command shows all service unit files and their enabled/disabled state?

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 shows all service unit files and their enabled/disabled state?

Explanation:
To see every service unit file on disk and whether it’s set to start automatically, you use systemctl list-unit-files with a type filter for service. This command lists all service unit files and shows their enablement state (enabled, disabled, static, or masked), which tells you which units are configured to boot and which aren’t. The type=service restriction ensures you’re looking specifically at service units. The other options don’t fit: systemctl status is for checking the status of units (often a single unit or general system status) rather than listing all unit files. list-unit-files --type=socket narrows to socket units, not services. list-units --type=service shows currently active service units, not every service unit file on disk or its enablement state.

To see every service unit file on disk and whether it’s set to start automatically, you use systemctl list-unit-files with a type filter for service. This command lists all service unit files and shows their enablement state (enabled, disabled, static, or masked), which tells you which units are configured to boot and which aren’t. The type=service restriction ensures you’re looking specifically at service units.

The other options don’t fit: systemctl status is for checking the status of units (often a single unit or general system status) rather than listing all unit files. list-unit-files --type=socket narrows to socket units, not services. list-units --type=service shows currently active service units, not every service unit file on disk or its enablement state.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy