List target units currently loaded by systemd without changing state.
Which command is appropriate?
systemctl list-units --type=target lists loaded target units and their active state.
Detailed explanation
systemctl list-units --type=targetCorrect. This lists target units known to the running system manager.
systemctl isolate --allIncorrect. isolate changes the current target and does not accept --all for this query.
systemctl set-default --listIncorrect. set-default --list is not the listing operation.
systemctl reboot --targetsIncorrect. reboot changes system state rather than listing units.
Try it yourself
An example you can run in a temporary verification environment.
systemctl list-units --type=target --no-pager 2>/dev/null | head || trueExpected result
読み込まれているtarget unitの一部Key points
- list-units
- --type=target
- Unit state
Notes
- Environment: systemd採用Linux
- Use read-only commands or a disposable Linux instance when checking boot metadata.
- Exact unit names and command output can vary slightly by distribution.
Foundation review
Place the operation
list-units shows loaded runtime units; list-unit-files instead reports unit files and enablement on disk.
Check the side effect
Capture the unit state and name before issuing any lifecycle command.