Which command shows all available target unit files on the system?

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 available target unit files on the system?

Explanation:
Targets in systemd are a kind of unit that groups other units to define boot and run states. To see every target unit file that exists on the system, you query the unit files themselves rather than the units currently loaded. The right command is systemctl list-unit-files --type=target. It scans the standard unit directories and lists each target unit file along with its enablement state (enabled, disabled, static, etc.), showing what’s available to be used in the boot graph, even if it isn’t active right now. Using --type=service or --type=socket would limit the output to service or socket unit files, not targets. Using systemctl list-units --type=target would display only target units that are currently loaded and active, which doesn’t reflect all available target unit files on the system.

Targets in systemd are a kind of unit that groups other units to define boot and run states. To see every target unit file that exists on the system, you query the unit files themselves rather than the units currently loaded. The right command is systemctl list-unit-files --type=target. It scans the standard unit directories and lists each target unit file along with its enablement state (enabled, disabled, static, etc.), showing what’s available to be used in the boot graph, even if it isn’t active right now.

Using --type=service or --type=socket would limit the output to service or socket unit files, not targets. Using systemctl list-units --type=target would display only target units that are currently loaded and active, which doesn’t reflect all available target unit files on the system.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy