Which command lists all failed service units?

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 all failed service units?

Explanation:
You’re asking systemd to show units that aren’t running correctly, and you want only service units. The right approach is to use the tool’s filtering flags: --failed to surface units that have failed, and --type=service to limit the results to service units. Putting those together with systemctl yields a clean list of all failed services, which is exactly what you need to diagnose service startup or runtime problems. The other options don’t fit because they don’t combine the correct state filter with the correct unit type, or they operate on different data. A subcommand that doesn’t exist would cause an error, and listing unit files focuses on definitions rather than runtime status. Using status with --failed is less direct for compiling a full list of failed services.

You’re asking systemd to show units that aren’t running correctly, and you want only service units. The right approach is to use the tool’s filtering flags: --failed to surface units that have failed, and --type=service to limit the results to service units. Putting those together with systemctl yields a clean list of all failed services, which is exactly what you need to diagnose service startup or runtime problems.

The other options don’t fit because they don’t combine the correct state filter with the correct unit type, or they operate on different data. A subcommand that doesn’t exist would cause an error, and listing unit files focuses on definitions rather than runtime status. Using status with --failed is less direct for compiling a full list of failed services.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy