Inspect the target systemd will use for the next normal boot without changing it.
Which command is appropriate?
systemctl get-default prints the target resolved by default.target for normal boot.
Detailed explanation
systemctl isolate default.targetIncorrect. isolate changes the current target.
systemctl enable default.targetIncorrect. enable changes boot-time activation and is not a read-only query.
systemctl get-defaultCorrect. systemctl get-default displays the configured default target.
systemctl reboot --dry-runIncorrect. reboot changes system state rather than inspecting the default.
Try it yourself
An example you can run in a temporary verification environment.
systemctl get-default 2>/dev/null || trueExpected result
multi-user.targetやgraphical.target等Key points
- get-default
- default.target
- Read-only check
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
get-default reports the default target; isolate and set-default have different state-changing effects.
Check the side effect
Run the query before changing a target so the current configuration is recorded.